Instructions to use diffusers/controlnet-canny-sdxl-1.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use diffusers/controlnet-canny-sdxl-1.0 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("diffusers/controlnet-canny-sdxl-1.0", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps
- Draw Things
- DiffusionBee
Update README.md
Browse files
README.md
CHANGED
|
@@ -48,7 +48,8 @@ image = load_image("https://huggingface.co/datasets/hf-internal-testing/diffuser
|
|
| 48 |
controlnet_conditioning_scale = 0.5 # recommended for good generalization
|
| 49 |
|
| 50 |
controlnet = ControlNetModel.from_pretrained(
|
| 51 |
-
"diffusers/controlnet-sdxl-1.0",
|
|
|
|
| 52 |
)
|
| 53 |
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
|
| 54 |
pipe = StableDiffusionXLControlNetPipeline.from_pretrained(
|
|
@@ -68,7 +69,7 @@ images = pipe(
|
|
| 68 |
prompt, image=image, controlnet_conditioning_scale=controlnet_conditioning_scale,
|
| 69 |
).images
|
| 70 |
|
| 71 |
-
|
| 72 |
```
|
| 73 |
|
| 74 |

|
|
|
|
| 48 |
controlnet_conditioning_scale = 0.5 # recommended for good generalization
|
| 49 |
|
| 50 |
controlnet = ControlNetModel.from_pretrained(
|
| 51 |
+
"diffusers/controlnet-sdxl-1.0",
|
| 52 |
+
torch_dtype=torch.float16
|
| 53 |
)
|
| 54 |
vae = AutoencoderKL.from_pretrained("madebyollin/sdxl-vae-fp16-fix", torch_dtype=torch.float16)
|
| 55 |
pipe = StableDiffusionXLControlNetPipeline.from_pretrained(
|
|
|
|
| 69 |
prompt, image=image, controlnet_conditioning_scale=controlnet_conditioning_scale,
|
| 70 |
).images
|
| 71 |
|
| 72 |
+
images[0].save(f"hug_lab.png")
|
| 73 |
```
|
| 74 |
|
| 75 |

|