XLabs-AI/flux-controlnet-depth-diffusers
13164
1---2license: other3language:4- en5base_model:6- black-forest-labs/FLUX.1-dev7pipeline_tag: text-to-image8tags:9- diffusers10- controlnet11- Flux12- image-generation13---14 15# Description16This repository provides a Diffusers version of FLUX.1-dev Depth ControlNet checkpoint by Xlabs AI, [original repo](https://huggingface.co/XLabs-AI/flux-controlnet-depth-v3). 17 1819 20# How to use21This model can be used directly with the diffusers library22 23```24import torch25from diffusers.utils import load_image26from diffusers import FluxControlNetModel27from diffusers.pipelines import FluxControlNetPipeline28from PIL import Image29import numpy as np30 31generator = torch.Generator(device="cuda").manual_seed(87544357)32 33controlnet = FluxControlNetModel.from_pretrained(34 "Xlabs-AI/flux-controlnet-depth-diffusers",35 torch_dtype=torch.bfloat16,36 use_safetensors=True,37)38pipe = FluxControlNetPipeline.from_pretrained(39 "black-forest-labs/FLUX.1-dev",40 controlnet=controlnet,41 torch_dtype=torch.bfloat1642)43pipe.to("cuda")44 45control_image = load_image("https://huggingface.co/Xlabs-AI/flux-controlnet-depth-diffusers/resolve/main/depth_example.png")46prompt = "photo of fashion woman in the street"47 48image = pipe(49 prompt,50 control_image=control_image,51 controlnet_conditioning_scale=0.7,52 num_inference_steps=25,53 guidance_scale=3.5,54 height=768,55 width=1024,56 generator=generator,57 num_images_per_prompt=1,58).images[0]59 60image.save("output_test_controlnet.png")61```62 63## License64 65Our weights fall under the [FLUX.1 [dev]](https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md) Non-Commercial License<br/>