Update README.md
Browse files
README.md
CHANGED
@@ -44,9 +44,15 @@ BRIA-4B-Adapt-ControlNet-Union requires access to BRIA-4B-Adapt Text-to-Image. F
|
|
44 |
|
45 |
|
46 |
```python
|
47 |
-
|
48 |
```
|
49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
|
51 |
```python
|
52 |
from huggingface_hub import hf_hub_download
|
@@ -61,7 +67,10 @@ hf_hub_download(repo_id="briaai/BRIA-4B-Adapt", filename='transformer_bria.py',
|
|
61 |
hf_hub_download(repo_id="briaai/BRIA-4B-Adapt", filename='bria_utils.py', local_dir=local_dir)
|
62 |
hf_hub_download(repo_id="briaai/BRIA-4B-Adapt-ControlNet-Union", filename='pipeline_bria_controlnet.py', local_dir=local_dir)
|
63 |
hf_hub_download(repo_id="briaai/BRIA-4B-Adapt-ControlNet-Union", filename='controlnet_bria.py', local_dir=local_dir)
|
|
|
64 |
|
|
|
|
|
65 |
import torch
|
66 |
from diffusers.utils import load_image
|
67 |
from controlnet_bria import BriaControlNetModel
|
@@ -124,21 +133,6 @@ print(image)
|
|
124 |
|
125 |
# Multi-Controls Inference
|
126 |
```python
|
127 |
-
from huggingface_hub import hf_hub_download
|
128 |
-
import os
|
129 |
-
|
130 |
-
try:
|
131 |
-
local_dir = os.path.dirname(__file__)
|
132 |
-
except:
|
133 |
-
local_dir = '.'
|
134 |
-
|
135 |
-
hf_hub_download(repo_id="briaai/BRIA-4B-Adapt", filename='pipeline_bria.py', local_dir=local_dir)
|
136 |
-
hf_hub_download(repo_id="briaai/BRIA-4B-Adapt", filename='transformer_bria.py', local_dir=local_dir)
|
137 |
-
hf_hub_download(repo_id="briaai/BRIA-4B-Adapt", filename='bria_utils.py', local_dir=local_dir)
|
138 |
-
hf_hub_download(repo_id="briaai/BRIA-3.0-ControlNet-Union", filename='pipeline_bria_controlnet.py', local_dir=local_dir)
|
139 |
-
hf_hub_download(repo_id="briaai/BRIA-3.0-ControlNet-Union", filename='controlnet_bria.py', local_dir=local_dir)
|
140 |
-
|
141 |
-
|
142 |
import torch
|
143 |
from diffusers.utils import load_image
|
144 |
from controlnet_bria import BriaControlNetModel, BriaMultiControlNetModel
|
@@ -154,8 +148,8 @@ controlnet = BriaMultiControlNetModel([controlnet])
|
|
154 |
pipe = BriaControlNetPipeline.from_pretrained(base_model, controlnet=controlnet, torch_dtype=torch.bfloat16, trust_remote_code=True)
|
155 |
pipe.to("cuda")
|
156 |
|
157 |
-
control_image_colorgrid = load_image("https://huggingface.co/briaai/BRIA-3.0-ControlNet-Union/resolve/main/colorgrid.jpg")
|
158 |
-
control_image_pose = load_image("https://huggingface.co/briaai/BRIA-3.0-ControlNet-Union/resolve/main/pose.jpg")
|
159 |
|
160 |
control_image = [control_image_colorgrid, control_image_pose]
|
161 |
controlnet_conditioning_scale = [0.5, 0.5]
|
|
|
44 |
|
45 |
|
46 |
```python
|
47 |
+
|
48 |
```
|
49 |
|
50 |
+
### Installations
|
51 |
+
|
52 |
+
```bash
|
53 |
+
pip install -qr https://huggingface.co/briaai/BRIA-4B-Adapt/resolve/main/requirements.txt
|
54 |
+
pip install diffusers==0.30.2, hf_hub_download
|
55 |
+
```
|
56 |
|
57 |
```python
|
58 |
from huggingface_hub import hf_hub_download
|
|
|
67 |
hf_hub_download(repo_id="briaai/BRIA-4B-Adapt", filename='bria_utils.py', local_dir=local_dir)
|
68 |
hf_hub_download(repo_id="briaai/BRIA-4B-Adapt-ControlNet-Union", filename='pipeline_bria_controlnet.py', local_dir=local_dir)
|
69 |
hf_hub_download(repo_id="briaai/BRIA-4B-Adapt-ControlNet-Union", filename='controlnet_bria.py', local_dir=local_dir)
|
70 |
+
```
|
71 |
|
72 |
+
## Inference
|
73 |
+
```python
|
74 |
import torch
|
75 |
from diffusers.utils import load_image
|
76 |
from controlnet_bria import BriaControlNetModel
|
|
|
133 |
|
134 |
# Multi-Controls Inference
|
135 |
```python
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
import torch
|
137 |
from diffusers.utils import load_image
|
138 |
from controlnet_bria import BriaControlNetModel, BriaMultiControlNetModel
|
|
|
148 |
pipe = BriaControlNetPipeline.from_pretrained(base_model, controlnet=controlnet, torch_dtype=torch.bfloat16, trust_remote_code=True)
|
149 |
pipe.to("cuda")
|
150 |
|
151 |
+
control_image_colorgrid = load_image("https://huggingface.co/briaai/BRIA-3.0-ControlNet-Union/resolve/main/images/colorgrid.jpg")
|
152 |
+
control_image_pose = load_image("https://huggingface.co/briaai/BRIA-3.0-ControlNet-Union/resolve/main/images/pose.jpg")
|
153 |
|
154 |
control_image = [control_image_colorgrid, control_image_pose]
|
155 |
controlnet_conditioning_scale = [0.5, 0.5]
|