
FLUX.1 Canny [dev] LoRA is a LoRA extracted from FLUX.1 Canny [dev], a 12 billion parameter rectified flow transformer capable of generating an image based on a text description while following the structure of a given input image.
For more information, please read our blog post.
The LoRA is applicable to FLUX.1 [dev].
FLUX.1 Canny [dev] LoRA more efficient.FLUX.1 [dev] Non-Commercial License.We provide a reference implementation of FLUX.1 Canny [dev], as well as sampling code, in a dedicated github repository.
Developers and creatives looking to build on top of FLUX.1 Canny [dev] are encouraged to use this as a starting point.
FLUX.1 Canny [pro] is available in our API bfl.ml
To use FLUX.1-Depth-dev-lora with the 🧨 diffusers python library, first install or upgrade diffusers, peft, and controlnet_aux.
pip install -U git+https://github.com/huggingface/diffusers pip install -U controlnet-aux pip install -U peft
Then you can use the FluxControlPipeline to run it:
import torch
from controlnet_aux import CannyDetector
from diffusers import FluxControlPipeline
from diffusers.utils import load_image
pipe = FluxControlPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16).to("cuda")
pipe.load_lora_weights("black-forest-labs/FLUX.1-Canny-dev-lora", adapter_name="canny")
pipe.set_adapters("canny", 0.85)
prompt = "A robot made of exotic candies and chocolates of different kinds. The background is filled with confetti and celebratory gifts."
control_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/robot.png")
processor = CannyDetector()
control_image = processor(control_image, low_threshold=50, high_threshold=200, detect_resolution=1024, image_resolution=1024)
image = pipe(
prompt=prompt,
control_image=control_image,
height=1024,
width=1024,
num_inference_steps=50,
guidance_scale=30.0,
).images[0]
image.save("output.png")
To learn more, check out the diffusers documentation.
The model and its derivatives may not be used
This model falls under the FLUX.1 [dev] Non-Commercial License.