forked from cgvr/DeltaVR
18 lines
484 B
Python
18 lines
484 B
Python
import torch
|
|
from diffusers import StableDiffusion3Pipeline
|
|
|
|
model_name = "stabilityai/stable-diffusion-3.5-medium"
|
|
|
|
pipe = StableDiffusion3Pipeline.from_pretrained(model_name, use_safetensors=True, variant="fp16")
|
|
pipe = pipe.to("cuda")
|
|
|
|
prompt = "A cute cat eating a slice of pizza, stunning color scheme, masterpiece, illustration"
|
|
image = pipe(
|
|
prompt,
|
|
guidance_scale=3.0,
|
|
generator=torch.Generator("cuda")
|
|
).images[0]
|
|
|
|
image_name = "image.png"
|
|
image.save(image_name)
|