Instructions to use alibaba-pai/FLUX.2-dev-Fun-Controlnet-Union with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- VideoX Fun
How to use alibaba-pai/FLUX.2-dev-Fun-Controlnet-Union with VideoX Fun:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,115 +1,116 @@
|
|
| 1 |
-
---
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
---
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
-
|
| 13 |
-
-
|
| 14 |
-
-
|
| 15 |
-
-
|
| 16 |
-
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
<td>
|
| 27 |
-
|
| 28 |
-
<tr>
|
| 29 |
-
|
| 30 |
-
<td><img src="
|
| 31 |
-
|
| 32 |
-
</
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
<td>
|
| 38 |
-
|
| 39 |
-
<tr>
|
| 40 |
-
|
| 41 |
-
<td><img src="
|
| 42 |
-
|
| 43 |
-
</
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
<td>
|
| 49 |
-
|
| 50 |
-
<tr>
|
| 51 |
-
|
| 52 |
-
<td><img src="
|
| 53 |
-
|
| 54 |
-
</
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
<td>
|
| 60 |
-
|
| 61 |
-
<tr>
|
| 62 |
-
|
| 63 |
-
<td><img src="
|
| 64 |
-
|
| 65 |
-
</
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
<td>
|
| 71 |
-
|
| 72 |
-
<tr>
|
| 73 |
-
|
| 74 |
-
<td><img src="
|
| 75 |
-
|
| 76 |
-
</
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
<td>
|
| 82 |
-
|
| 83 |
-
<tr>
|
| 84 |
-
|
| 85 |
-
<td><img src="
|
| 86 |
-
|
| 87 |
-
</
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
mkdir models/
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
|
|
|
| 115 |
Then run the file `examples/flux2_fun/predict_t2i_control.py`.
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: videox_fun
|
| 3 |
+
license: other
|
| 4 |
+
license_name: flux-dev-non-commercial-license
|
| 5 |
+
license_link: https://huggingface.co/black-forest-labs/FLUX.2-dev/blob/main/LICENSE.txt
|
| 6 |
+
---
|
| 7 |
+
# Flux.2-dev-Fun-Controlnet-Union
|
| 8 |
+
|
| 9 |
+
[](https://github.com/aigc-apps/VideoX-Fun)
|
| 10 |
+
|
| 11 |
+
# Model features
|
| 12 |
+
- This ControlNet is added on 4 double blocks.
|
| 13 |
+
- The model was trained from scratch for 10,000 steps on a dataset of 1 million high-quality images covering both general and human-centric content. Training was performed at 1328 resolution using BFloat16 precision, with a batch size of 64, a learning rate of 2e-5, and a text dropout ratio of 0.10.
|
| 14 |
+
- It supports multiple control conditionsโincluding Canny, HED, depth maps, pose estimation, and MLSD can be used like a standard ControlNet.
|
| 15 |
+
- Inpainting mode is also supported.
|
| 16 |
+
- You can adjust controlnet_conditioning_scale for stronger control and better detail preservation. For better stability, we highly recommend using a detailed prompt. The optimal range for controlnet_conditioning_scale is from 0.65 to 0.80.
|
| 17 |
+
- Although Flux.2โdev supports certain imageโediting capabilities, its generation speed slows down when handling multiple images, and it sometimes produces similarity issues or fails to follow the control images. Compared with editโbased methods, using ControlNet adheres more reliably to control instructions and makes it easier to apply multiple types of control.
|
| 18 |
+
|
| 19 |
+
# TODO
|
| 20 |
+
- [ ] Train more data and steps.
|
| 21 |
+
|
| 22 |
+
# Results
|
| 23 |
+
|
| 24 |
+
<table border="0" style="width: 100%; text-align: left; margin-top: 20px;">
|
| 25 |
+
<tr>
|
| 26 |
+
<td>Pose</td>
|
| 27 |
+
<td>Output</td>
|
| 28 |
+
</tr>
|
| 29 |
+
<tr>
|
| 30 |
+
<td><img src="asset/ref.jpg" width="100%" /><img src="asset/mask.jpg" width="100%" /></td>
|
| 31 |
+
<td><img src="results/inpaint.png" width="100%" /></td>
|
| 32 |
+
</tr>
|
| 33 |
+
</table>
|
| 34 |
+
|
| 35 |
+
<table border="0" style="width: 100%; text-align: left; margin-top: 20px;">
|
| 36 |
+
<tr>
|
| 37 |
+
<td>Pose</td>
|
| 38 |
+
<td>Output</td>
|
| 39 |
+
</tr>
|
| 40 |
+
<tr>
|
| 41 |
+
<td><img src="asset/pose.jpg" width="100%" /><img src="asset/ref.jpg" width="100%" /></td>
|
| 42 |
+
<td><img src="results/pose_ref.png" width="100%" /></td>
|
| 43 |
+
</tr>
|
| 44 |
+
</table>
|
| 45 |
+
|
| 46 |
+
<table border="0" style="width: 100%; text-align: left; margin-top: 20px;">
|
| 47 |
+
<tr>
|
| 48 |
+
<td>Pose</td>
|
| 49 |
+
<td>Output</td>
|
| 50 |
+
</tr>
|
| 51 |
+
<tr>
|
| 52 |
+
<td><img src="asset/pose.jpg" width="100%" /></td>
|
| 53 |
+
<td><img src="results/pose.png" width="100%" /></td>
|
| 54 |
+
</tr>
|
| 55 |
+
</table>
|
| 56 |
+
|
| 57 |
+
<table border="0" style="width: 100%; text-align: left; margin-top: 20px;">
|
| 58 |
+
<tr>
|
| 59 |
+
<td>Pose</td>
|
| 60 |
+
<td>Output</td>
|
| 61 |
+
</tr>
|
| 62 |
+
<tr>
|
| 63 |
+
<td><img src="asset/pose2.jpg" width="100%" /></td>
|
| 64 |
+
<td><img src="results/pose2.png" width="100%" /></td>
|
| 65 |
+
</tr>
|
| 66 |
+
</table>
|
| 67 |
+
|
| 68 |
+
<table border="0" style="width: 100%; text-align: left; margin-top: 20px;">
|
| 69 |
+
<tr>
|
| 70 |
+
<td>Canny</td>
|
| 71 |
+
<td>Output</td>
|
| 72 |
+
</tr>
|
| 73 |
+
<tr>
|
| 74 |
+
<td><img src="asset/canny.jpg" width="100%" /></td>
|
| 75 |
+
<td><img src="results/canny.png" width="100%" /></td>
|
| 76 |
+
</tr>
|
| 77 |
+
</table>
|
| 78 |
+
|
| 79 |
+
<table border="0" style="width: 100%; text-align: left; margin-top: 20px;">
|
| 80 |
+
<tr>
|
| 81 |
+
<td>Canny</td>
|
| 82 |
+
<td>Output</td>
|
| 83 |
+
</tr>
|
| 84 |
+
<tr>
|
| 85 |
+
<td><img src="asset/depth.jpg" width="100%" /></td>
|
| 86 |
+
<td><img src="results/depth.png" width="100%" /></td>
|
| 87 |
+
</tr>
|
| 88 |
+
</table>
|
| 89 |
+
|
| 90 |
+
# Inference
|
| 91 |
+
Go to VideoX-Fun repository for more details.
|
| 92 |
+
|
| 93 |
+
Please git clone VideoX-Fun and mkdirs.
|
| 94 |
+
```sh
|
| 95 |
+
# clone code
|
| 96 |
+
git clone https://github.com/aigc-apps/VideoX-Fun.git
|
| 97 |
+
|
| 98 |
+
# enter VideoX-Fun's dir
|
| 99 |
+
cd VideoX-Fun
|
| 100 |
+
|
| 101 |
+
# download weights
|
| 102 |
+
mkdir models/Diffusion_Transformer
|
| 103 |
+
mkdir models/Personalized_Model
|
| 104 |
+
```
|
| 105 |
+
|
| 106 |
+
Then download weights to models/Diffusion_Transformer and models/Personalized_Model.
|
| 107 |
+
|
| 108 |
+
```
|
| 109 |
+
๐ฆ models/
|
| 110 |
+
โโโ ๐ Diffusion_Transformer/
|
| 111 |
+
โ โโโ ๐ FLUX.2-dev/
|
| 112 |
+
โโโ ๐ Personalized_Model/
|
| 113 |
+
โ โโโ "models/Personalized_Model/FLUX.2-dev-Fun-Controlnet-Union.safetensors"
|
| 114 |
+
```
|
| 115 |
+
|
| 116 |
Then run the file `examples/flux2_fun/predict_t2i_control.py`.
|