Instructions to use jasperai/Flux.1-dev-Controlnet-Depth with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use jasperai/Flux.1-dev-Controlnet-Depth with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("jasperai/Flux.1-dev-Controlnet-Depth", torch_dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -28,7 +28,11 @@ pipe = FluxControlNetPipeline.from_pretrained(
|
|
| 28 |
|
| 29 |
|
| 30 |
# Load a control image
|
| 31 |
-
control_image = load_image(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
image = pipe(
|
| 34 |
prompt,
|
|
@@ -41,7 +45,7 @@ image.save("image.jpg")
|
|
| 41 |
```
|
| 42 |
|
| 43 |
<p align="center">
|
| 44 |
-
<img style="width:700px;" src="
|
| 45 |
</p>
|
| 46 |
|
| 47 |
# Licence
|
|
|
|
| 28 |
|
| 29 |
|
| 30 |
# Load a control image
|
| 31 |
+
control_image = load_image(
|
| 32 |
+
"https://huggingface.co/jasperai/Flux.1-dev-Controlnet-Depth/resolve/main/examples/depth.jpg"
|
| 33 |
+
)
|
| 34 |
+
|
| 35 |
+
prompt = "a statue of a gnome in a field of purple tulips"
|
| 36 |
|
| 37 |
image = pipe(
|
| 38 |
prompt,
|
|
|
|
| 45 |
```
|
| 46 |
|
| 47 |
<p align="center">
|
| 48 |
+
<img style="width:700px;" src="examples/output.jpg">
|
| 49 |
</p>
|
| 50 |
|
| 51 |
# Licence
|