--- license: other license_name: bria-2.0 license_link: LICENSE library_name: diffusers inference: parameters: num_inference_steps: 50 tags: - text-to-image - controlnet model - legal liability - commercial use extra_gated_prompt: This model weights by BRIA AI can be obtained after a commercial license is agreed upon. Fill in the form below and we reach out to you. extra_gated_fields: Name: text Company/Org name: text Org Type (Early/Growth Startup, Enterprise, Academy): text Role: text Country: text Email: text By submitting this form, I agree to BRIA’s Privacy policy and Terms & conditions, see links below: checkbox --- # BRIA 2.0 ControlNet Canny Model Card BRIA 2.0 trained exclusively on the largest multi-source commercial-grade licensed dataset, BRIA 2.0 guarantees best quality while safe for commercial use. BRIA's models were trained from scratch exclusively on licensed data from our esteemed data partners, including Getty Images, Alamy (part of PA Media Group), Envato, boutique niche agencies, independent photographers and artists. BRIA 2.0 is safe for commercial use and provides full legal liability coverage for copyright and privacy infrigement and harmful content mitigation. In addition, having been trained on commercial-grade data, BRIA models set new standards of safety, diversity, equity and inclusion. Our dataset does not represent copyrighted materials, such as fictional characters, logos or trademarks, public figures, harmful content or privacy infringing content. Generation of these concepts using our models is impractical. BRIA 2.0 ControlNet-Canny was trained on top of BRIA 2.0 Text-to-Image. ![pexels-photo-4426232_collage.png](https://cdn-uploads.huggingface.co/production/uploads/6571c468b622b6c62c1ac4da/VzUtWzN0KdT7B-xoBNEcB.png) ### Model Description - **Developed by:** BRIA AI - **Model type:** Latent diffusion image-to-image model - **License:** [bria-2.0](https://bria.ai/bria-2-0-huggingface-model-license-agreement/) - **Model Description:** BRIA 2.0 Text-to-Image model and BRIA 2.0 ControlNet-Canny models were trained exclusively on a professional-grade, licensed dataset. They are designed for commercial use and includes full legal liability coverage. - **Resources for more information:** [BRIA AI](https://bria.ai/) ### Get Access BRIA 2.0 Text-to-Image and BRIA 2.0 ControlNet-Canny are available under the BRIA 2.0 License Agreement, allowing commercial usage with an attribution model that supports our data contributors. To access the model, please contact us. By submitting this form, you agree to BRIA’s [Privacy policy](https://bria.ai/privacy-policy/) and [Terms & conditions](https://bria.ai/terms-and-conditions/). ### Code example using Diffusers ``` pip install diffusers ``` ```py from diffusers import ControlNetModel, StableDiffusionXLControlNetPipeline import torch controlnet = ControlNetModel.from_pretrained( "briaai/ControlNet-Canny", torch_dtype=torch.float16 ) pipe = StableDiffusionXLControlNetPipeline.from_pretrained( "briaai/BRIA-2.0", controlnet=controlnet, torch_dtype=torch.float16, ) pipe.to("cuda") prompt = "A portrait of a Beautiful and playful ethereal singer, golden designs, highly detailed, blurry background" negative_prompt = "Logo,Watermark,Text,Ugly,Morbid,Extra fingers,Poorly drawn hands,Mutation,Blurry,Extra limbs,Gross proportions,Missing arms,Mutated hands,Long neck,Duplicate,Mutilated,Mutilated hands,Poorly drawn face,Deformed,Bad anatomy,Cloned face,Malformed limbs,Missing legs,Too many fingers" # Calculate Canny image input_image = cv2.imread('pics/singer.png') input_image = cv2.Canny(input_image, low_threshold, high_threshold) input_image = input_image[:, :, None] input_image = np.concatenate([input_image, input_image, input_image], axis=2) canny_image = Image.fromarray(image) image = pipe(prompt=prompt, negative_prompt=negative_prompt, image=canny_image, controlnet_conditioning_scale=1.0, height=1024, width=1024).images[0] ```