File size: 510 Bytes
785550f f3384eb 785550f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
from diffusers import DiffusionPipeline
import torch.nn as nn, torch, types
MODEL_DIR = "opendiffusionai/stablediffusionxl_t5"
pipe = DiffusionPipeline.from_pretrained(
MODEL_DIR, custom_pipeline=MODEL_DIR, use_safetensors=True,
torch_dtype=torch.bfloat16,
)
print("model initialized. Now moving to CUDA")
pipe.to("cuda")
print("Trying render now...")
images = pipe("a misty Tokyo alley at night",num_inference_steps=30).images
fname="save.png"
print(f"saving to {fname}")
images[0].save(fname)
|