Views
No views yet
a cute anime character named toast, holding a sign that reads SOON4.00.730None4204204201024x10241import torch
2from diffusers import DiffusionPipeline
3
4model_id = 'pixart-900m-1024-ft-v0.7-stage2'
5pipeline = DiffusionPipeline.from_pretrained(model_id)
6
7prompt = "a cute anime character named toast, holding a sign that reads SOON"
8negative_prompt = "blurry, cropped, ugly"
9
10pipeline.to('cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu')
11image = pipeline(
12 prompt=prompt,
13 negative_prompt='blurry, cropped, ugly',
14 num_inference_steps=30,
15 generator=torch.Generator(device='cuda' if torch.cuda.is_available() else 'mps' if torch.backends.mps.is_available() else 'cpu').manual_seed(1641421826),
16 width=1152,
17 height=768,
18 guidance_scale=4.0,
19 guidance_rescale=0.7,
20).images[0]
21image.save("output.png", format="PNG")