mirror of https://github.com/hpcaitech/ColossalAI
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
351 B
13 lines
351 B
import torch
|
|
from diffusers import DiffusionPipeline
|
|
|
|
model_id = "<Your Model Path>"
|
|
print(f"Loading model... from{model_id}")
|
|
|
|
pipe = DiffusionPipeline.from_pretrained(model_id, torch_dtype=torch.float16).to("cuda")
|
|
|
|
prompt = "A photo of an apple."
|
|
image = pipe(prompt, num_inference_steps=50, guidance_scale=7.5).images[0]
|
|
|
|
image.save("output.png")
|