HelloTestUser/FLUX.1-Canny-dev
034
1---2language:3- en4license: other5license_name: flux-1-dev-non-commercial-license6license_link: LICENSE.md7extra_gated_prompt: >-8 By clicking "Agree", you agree to the [FluxDev Non-Commercial License9 Agreement](https://huggingface.co/black-forest-labs/FLUX.1-Canny-dev/blob/main/LICENSE.md)10 and acknowledge the [Acceptable Use11 Policy](https://huggingface.co/black-forest-labs/FLUX.1-Canny-dev/blob/main/POLICY.md).12tags:13- image-generation14- flux15- diffusion-single-file16---17 1819 20`FLUX.1 Canny [dev]` is 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](https://blackforestlabs.ai/flux-1-tools/). 21 22# Key Features231. Cutting-edge output quality.242. It blends impressive prompt adherence with maintaining the structure of source images based on canny edges.253. Trained using guidance distillation, making `FLUX.1 Canny [dev]` more efficient.264. Open weights to drive new scientific research, and empower artists to develop innovative workflows.275. Generated outputs can be used for personal, scientific, and commercial purposes as described in the [`FLUX.1 [dev]` Non-Commercial License](https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md).28 29# Usage30We provide a reference implementation of `FLUX.1 Canny [dev]`, as well as sampling code, in a dedicated [github repository](https://github.com/black-forest-labs/flux).31Developers and creatives looking to build on top of `FLUX.1 Canny [dev]` are encouraged to use this as a starting point.32 33## API Endpoints34`FLUX.1 Canny [pro]` is available in our API [bfl.ml](https://docs.bfl.ml/)35 3637 38## Diffusers39 40To use `FLUX.1-Canny-dev` with the 🧨 diffusers python library, first install or upgrade `diffusers` and `controlnet_aux`.41 42```bash43pip install -U diffusers controlnet_aux44```45 46Then you can use `FluxControlPipeline` to run the model47 48```python49import torch50from controlnet_aux import CannyDetector51from diffusers import FluxControlPipeline52from diffusers.utils import load_image53 54pipe = FluxControlPipeline.from_pretrained("black-forest-labs/FLUX.1-Canny-dev", torch_dtype=torch.bfloat16).to("cuda")55 56prompt = "A robot made of exotic candies and chocolates of different kinds. The background is filled with confetti and celebratory gifts."57control_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/robot.png")58 59processor = CannyDetector()60control_image = processor(control_image, low_threshold=50, high_threshold=200, detect_resolution=1024, image_resolution=1024)61 62image = pipe(63 prompt=prompt,64 control_image=control_image,65 height=1024,66 width=1024,67 num_inference_steps=50,68 guidance_scale=30.0,69).images[0]70image.save("output.png")71```72 73---74 75# Limitations76- This model is not intended or able to provide factual information.77- As a statistical model this checkpoint might amplify existing societal biases.78- The model may fail to generate output that matches the prompts.79- Prompt following is heavily influenced by the prompting-style.80 81# Out-of-Scope Use82The model and its derivatives may not be used83 84- In any way that violates any applicable national, federal, state, local or international law or regulation.85- For the purpose of exploiting, harming or attempting to exploit or harm minors in any way; including but not limited to the solicitation, creation, acquisition, or dissemination of child exploitative content.86- To generate or disseminate verifiably false information and/or content with the purpose of harming others.87- To generate or disseminate personal identifiable information that can be used to harm an individual.88- To harass, abuse, threaten, stalk, or bully individuals or groups of individuals.89- To create non-consensual nudity or illegal pornographic content.90- For fully automated decision making that adversely impacts an individual's legal rights or otherwise creates or modifies a binding, enforceable obligation.91- Generating or facilitating large-scale disinformation campaigns.92 93# License94This model falls under the [`FLUX.1 [dev]` Non-Commercial License](https://huggingface.co/black-forest-labs/FLUX.1-Canny-dev/blob/main/LICENSE.md).