Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ShivamShrirao
GitHub Repository: ShivamShrirao/diffusers
Path: blob/main/examples/research_projects/colossalai/inference.py
1979 views
1
import torch
2
3
from diffusers import StableDiffusionPipeline
4
5
6
model_id = "path-to-your-trained-model"
7
pipe = StableDiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to("cuda")
8
9
prompt = "A photo of sks dog in a bucket"
10
image = pipe(prompt, num_inference_steps=50, guidance_scale=7.5).images[0]
11
12
image.save("dog-bucket.png")
13
14