Download diffusers/examples/research_projects/colossalai/inference.py from basyd/sfx: direct link, hf CLI and curl.
- Browser
- Download file 345 Bytes
-
https://huggingface.co/spaces/basyd/sfx/resolve/main/diffusers/examples/research_projects/colossalai/inference.py
- Command line
-
hf download hf://spaces/basyd/sfx/diffusers/examples/research_projects/colossalai/inference.py
-
curl -L -o inference.py https://huggingface.co/spaces/basyd/sfx/resolve/main/diffusers/examples/research_projects/colossalai/inference.py
345 Bytes
| 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") | |