Script to run with Diffusers

#1
by charchits7 - opened

Hey, @John6666 could you please share a running script with Diffusers for this model?

Probably like this. It doesn't matter whether it's above or below. If you want to emphasize it by adding parentheses, use the pattern below.

import torch
from PIL import Image
from diffusers import StableDiffusionXLPipeline

# Standard
device = "cuda" if torch.cuda.is_available() else "cpu"
pipe = StableDiffusionXLPipeline.from_pretrained('John6666/nova-reality-pony-v70-sdxl', torch_dtype=torch.float16).to(device)
generator = torch.Generator(device).manual_seed(174)
prompt = "1girl"
negative_prompt = "bad anatomy"
img = pipe(
    prompt,
    negative_prompt=negative_prompt,
    guidance_scale=7,
    num_inference_steps=28,
    generator=generator,
).images[0]
img.save("_sample_generation.jpg")

# A1111 WebUI style prompt
device = "cuda" if torch.cuda.is_available() else "cpu"
pipe = StableDiffusionXLPipeline.from_pretrained('John6666/nova-reality-pony-v70-sdxl', torch_dtype=torch.float16, custom_pipeline="lpw_stable_diffusion_xl").to(device)
generator = torch.Generator(device).manual_seed(174)
prompt = "(1girl:1.3)"
negative_prompt = "bad anatomy"
img = pipe(
    prompt,
    negative_prompt=negative_prompt,
    guidance_scale=7,
    num_inference_steps=28,
    generator=generator,
    clip_skip=1,
).images[0]
img.save("_sample_generation_lpw.jpg")

Sign up or log in to comment