mirror of
https://github.com/huggingface/diffusers.git
synced 2026-01-27 17:22:53 +03:00
13 lines
345 B
Python
13 lines
345 B
Python
import torch
|
|
|
|
from diffusers import StableDiffusionPipeline
|
|
|
|
|
|
model_id = "path-to-your-trained-model"
|
|
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to("cuda")
|
|
|
|
prompt = "A photo of sks dog in a bucket"
|
|
image = pipe(prompt, num_inference_steps=50, guidance_scale=7.5).images[0]
|
|
|
|
image.save("dog-bucket.png")
|