Diffusers
TalHach61 commited on
Commit
737e60a
·
verified ·
1 Parent(s): 07373ed

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +42 -35
README.md CHANGED
@@ -7,33 +7,49 @@ license_link: https://bria.ai/legal-lobby
7
 
8
  # BRIA 3.0 ControlNet Union Model Card
9
 
 
10
 
11
- BRIA-3.0 ControlNet-Union, trained on the foundation of [BRIA-3.0 Text-to-Image](https://huggingface.co/briaai/BRIA-3.0-TOUCAN)
12
 
13
  [CLICK HERE FOR A DEMO](https://huggingface.co/spaces/briaai/BRIA-2.3-ControlNet-Pose)
14
 
15
- [BRIA 3.0](https://huggingface.co/briaai/BRIA-3.0-TOUCAN) was trained from scratch exclusively on licensed data from our esteemed data partners. Therefore, they are safe for commercial use and provide full legal liability coverage for copyright and privacy infringement, as well as harmful content mitigation. That is, our dataset does not contain copyrighted materials, such as fictional characters, logos, trademarks, public figures, harmful content, or privacy-infringing content.
16
 
17
  Join our [Discord community](https://discord.gg/Nxe9YW9zHS) for more information, tutorials, tools, and to connect with other users!
18
 
19
  ![controlnet_pose_showoff.png](https://huggingface.co/briaai/BRIA-2.3-ControlNet-Pose/resolve/main/controlnet_pose_showoff.png)
20
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
 
 
 
 
 
 
 
22
  ### Model Description
23
  - **Developed by:** BRIA AI
24
- - **Model type:** [ControlNet](https://huggingface.co/docs/diffusers/using-diffusers/controlnet) for Latent diffusion
25
- - **License:** [bria-3.0](https://bria.ai/bria-huggingface-model-license-agreement/)
 
26
 
27
  - **Model Description:** ControlNet Union for BRIA 3.0 Text-to-Image model. The model generates images guided by text and a conditioned image.
28
  - **Resources for more information:** [BRIA AI](https://bria.ai/)
29
 
30
 
31
- ### Get Access
32
- BRIA 3.0 ControlNet-Union requires access to BRIA 3.0 Text-to-Image. For more information, [click here](https://huggingface.co/briaai/BRIA-3.0-TOUCAN).
33
-
34
-
35
  ## Control Mode
36
-
37
  | Control Mode | Description |
38
  |:------------:|:-----------:|
39
  |0|depth
@@ -58,46 +74,46 @@ try:
58
  except:
59
  local_dir = '.'
60
 
61
- hf_hub_download(repo_id="briaai/BRIA-3.0-TOUCAN", filename='pipeline_bria.py', local_dir=local_dir)
62
- hf_hub_download(repo_id="briaai/BRIA-3.0-TOUCAN", filename='transformer_bria.py', local_dir=local_dir)
63
- hf_hub_download(repo_id="briaai/BRIA-3.0-TOUCAN", filename='bria_utils.py', local_dir=local_dir)
64
  hf_hub_download(repo_id="briaai/BRIA-3.0-ControlNet-Union", filename='pipeline_bria_controlnet.py', local_dir=local_dir)
65
  hf_hub_download(repo_id="briaai/BRIA-3.0-ControlNet-Union", filename='controlnet_bria.py', local_dir=local_dir)
66
 
67
-
68
  import torch
69
  from diffusers.utils import load_image
70
  from controlnet_bria import BriaControlNetModel, BriaMultiControlNetModel
71
  from pipeline_bria_controlnet import BriaControlNetPipeline
 
72
 
73
- <!-- from diffusers import FluxControlNetPipeline, FluxControlNetModel -->
74
-
75
- base_model = 'briaai/BRIA-3.0-TOUCAN'
76
  controlnet_model = 'briaai/BRIA-3.0-ControlNet-Union'
77
 
78
  controlnet = BriaControlNetModel.from_pretrained(controlnet_model, torch_dtype=torch.bfloat16)
79
- pipe = BriaControlNetPipeline.from_pretrained(base_model, controlnet=controlnet, torch_dtype=torch.bfloat16)
80
  pipe.to("cuda")
81
 
82
- control_image_canny = load_image("https://huggingface.co/InstantX/FLUX.1-dev-Controlnet-Union-alpha/resolve/main/images/canny.jpg")
83
- controlnet_conditioning_scale = 0.5
84
- control_mode = 0
85
 
86
- width, height = control_image.size
87
 
88
- prompt = 'A bohemian-style female travel blogger with sun-kissed skin and messy beach waves.'
89
 
 
90
  image = pipe(
91
  prompt,
92
- control_image=control_image,
93
  control_mode=control_mode,
94
  width=width,
95
  height=height,
96
  controlnet_conditioning_scale=controlnet_conditioning_scale,
97
- num_inference_steps=24,
98
- guidance_scale=3.5,
 
 
99
  ).images[0]
100
- image.save("image.jpg")
101
  ```
102
 
103
  # Multi-Controls Inference
@@ -137,12 +153,3 @@ image = pipe(
137
  ).images[0]
138
 
139
  ```
140
-
141
- # Resources
142
- - [InstantX/FLUX.1-dev-Controlnet-Canny](https://huggingface.co/InstantX/FLUX.1-dev-Controlnet-Canny)
143
- - [InstantX/FLUX.1-dev-Controlnet-Union](https://huggingface.co/InstantX/FLUX.1-dev-Controlnet-Union)
144
- - [Shakker-Labs/FLUX.1-dev-ControlNet-Depth](https://huggingface.co/Shakker-Labs/FLUX.1-dev-ControlNet-Depth)
145
- - [Shakker-Labs/FLUX.1-dev-ControlNet-Union-Pro](https://huggingface.co/Shakker-Labs/FLUX.1-dev-ControlNet-Union-Pro)
146
-
147
- # Acknowledgements
148
- Thanks [zzzzzero](https://github.com/zzzzzero) for help us pointing out some bugs in the training.
 
7
 
8
  # BRIA 3.0 ControlNet Union Model Card
9
 
10
+ BRIA-3.0 ControlNet-Union, trained on the foundation of [BRIA-4B-Adapt Text-to-Image](https://huggingface.co/briaai/BRIA-4B-Adapt), supports 6 control modes, including depth (0), canny (1), colorgrid (2), recolor (3), tile (4), pose (5). This model can be jointly used with other ControlNets.
11
 
12
+ This model combines technological innovation with ethical responsibility and legal security, setting a new standard in the AI industry. Bria AI licenses the foundation model with full legal liability coverage. Our dataset does not contain copyrighted materials, such as fictional characters, logos, trademarks, public figures, harmful content, or privacy-infringing content.
13
 
14
  [CLICK HERE FOR A DEMO](https://huggingface.co/spaces/briaai/BRIA-2.3-ControlNet-Pose)
15
 
16
+ For more information, please visit our [website](https://bria.ai/).
17
 
18
  Join our [Discord community](https://discord.gg/Nxe9YW9zHS) for more information, tutorials, tools, and to connect with other users!
19
 
20
  ![controlnet_pose_showoff.png](https://huggingface.co/briaai/BRIA-2.3-ControlNet-Pose/resolve/main/controlnet_pose_showoff.png)
21
 
22
+ ### Get Access
23
+ Interested in BRIA-3.0 ControlNet-Union? Purchase is required to license and access BRIA-3.0 ControlNet-Union, ensuring royalty management with our data partners and full liability coverage for commercial use.
24
+
25
+ Are you a startup or a student? We encourage you to apply for our [Startup Program](https://pages.bria.ai/the-visual-generative-ai-platform-for-builders-startups-plan?_gl=1*cqrl81*_ga*MTIxMDI2NzI5OC4xNjk5NTQ3MDAz*_ga_WRN60H46X4*MTcwOTM5OTMzNC4yNzguMC4xNzA5Mzk5MzM0LjYwLjAuMA..) to request access. This program are designed to support emerging businesses and academic pursuits with our cutting-edge technology.
26
+
27
+ Contact us today to unlock the potential of BRIA-4B-Adapt! By submitting the form above, you agree to BRIA’s [Privacy policy](https://bria.ai/privacy-policy/) and [Terms & conditions](https://bria.ai/terms-and-conditions/).
28
+
29
+ ## Key Features
30
+
31
+ - **Legally Compliant**: Offers full legal liability coverage for copyright and privacy infringements. Thanks to training on 100% licensed data from leading data partners, we ensure the ethical use of content.
32
+
33
+ - **Patented Attribution Engine**: Our attribution engine is our way to compensate our data partners, powered by our proprietary and patented algorithms.
34
 
35
+ - **Enterprise-Ready**: Specifically designed for business applications, Bria-4B-Adapt delivers high-quality fine-tuning capabilities for generating compliant imagery for a variety of commercial needs.
36
+
37
+ - **Customizable Technology**: Provides access to source code and weights for extensive customization, catering to specific business requirements.
38
+
39
+ - **Fully-Automated**: Provides access to fully no-code automatic fine-tuning capabilities on Bria's platform: https://platform.bria.ai/console/tailored-generation.
40
+
41
+
42
  ### Model Description
43
  - **Developed by:** BRIA AI
44
+ - **Model type:** Latent Flow-Matching Text-to-Image Model
45
+ - **License:** [Commercial licensing terms & conditions.](https://bria.ai/customer-general-terms-and-conditions)
46
+ - Purchase is required to license and access the model.
47
 
48
  - **Model Description:** ControlNet Union for BRIA 3.0 Text-to-Image model. The model generates images guided by text and a conditioned image.
49
  - **Resources for more information:** [BRIA AI](https://bria.ai/)
50
 
51
 
 
 
 
 
52
  ## Control Mode
 
53
  | Control Mode | Description |
54
  |:------------:|:-----------:|
55
  |0|depth
 
74
  except:
75
  local_dir = '.'
76
 
77
+ hf_hub_download(repo_id="briaai/BRIA-4B-Adapt", filename='pipeline_bria.py', local_dir=local_dir)
78
+ hf_hub_download(repo_id="briaai/BRIA-4B-Adapt", filename='transformer_bria.py', local_dir=local_dir)
79
+ hf_hub_download(repo_id="briaai/BRIA-4B-Adapt", filename='bria_utils.py', local_dir=local_dir)
80
  hf_hub_download(repo_id="briaai/BRIA-3.0-ControlNet-Union", filename='pipeline_bria_controlnet.py', local_dir=local_dir)
81
  hf_hub_download(repo_id="briaai/BRIA-3.0-ControlNet-Union", filename='controlnet_bria.py', local_dir=local_dir)
82
 
 
83
  import torch
84
  from diffusers.utils import load_image
85
  from controlnet_bria import BriaControlNetModel, BriaMultiControlNetModel
86
  from pipeline_bria_controlnet import BriaControlNetPipeline
87
+ import PIL.Image as Image
88
 
89
+ base_model = 'briaai/BRIA-4B-Adapt'
 
 
90
  controlnet_model = 'briaai/BRIA-3.0-ControlNet-Union'
91
 
92
  controlnet = BriaControlNetModel.from_pretrained(controlnet_model, torch_dtype=torch.bfloat16)
93
+ pipe = BriaControlNetPipeline.from_pretrained(base_model, controlnet=controlnet, torch_dtype=torch.bfloat16, trust_remote_code=True)
94
  pipe.to("cuda")
95
 
96
+ control_image_canny = load_image("https://huggingface.co/briaai/BRIA-3.0-ControlNet-Union/resolve/main/canny.jpg")
97
+ controlnet_conditioning_scale = 1.0
98
+ control_mode = 1
99
 
100
+ width, height = control_image_canny.size
101
 
102
+ prompt = 'In a serene living room, someone rests on a sapphire blue couch, diligently drawing in a rose-tinted notebook, with a sleek black coffee table, a muted green wall, an elegant geometric lamp, and a lush potted palm enhancing the peaceful ambiance.'
103
 
104
+ generator = torch.Generator(device="cuda").manual_seed(555)
105
  image = pipe(
106
  prompt,
107
+ control_image=control_image_canny,
108
  control_mode=control_mode,
109
  width=width,
110
  height=height,
111
  controlnet_conditioning_scale=controlnet_conditioning_scale,
112
+ num_inference_steps=50,
113
+ max_sequence_length=128,
114
+ guidance_scale=5,
115
+ generator=generator
116
  ).images[0]
 
117
  ```
118
 
119
  # Multi-Controls Inference
 
153
  ).images[0]
154
 
155
  ```