Views
No views yet
a photograph of ohwx woman4.20.020None421024x10241import torch
2from diffusers import DiffusionPipeline
3
4model_id = 'FastFreddi/simpletuner-v1-full'
5pipeline = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.bfloat16) # loading directly in bf16
6
7prompt = "a photograph of ohwx woman"
8negative_prompt = 'blurry, cropped, ugly'
9
10pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu') # the pipeline is already in its target precision level
11image = pipeline(
12 prompt=prompt,
13 negative_prompt=negative_prompt,
14 num_inference_steps=20,
15 generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(42),
16 width=1024,
17 height=1024,
18 guidance_scale=4.2,
19 guidance_rescale=0.0,
20).images[0]
21image.save("output.png", format="PNG")