thanks to alimama-creative ❤
Browse files- README.md +131 -0
- config.json +20 -0
- diffusion_pytorch_model.safetensors +3 -0
README.md
ADDED
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: other
|
3 |
+
license_name: flux-1-dev-non-commercial-license
|
4 |
+
license_link: https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md
|
5 |
+
language:
|
6 |
+
- en
|
7 |
+
base_model:
|
8 |
+
- black-forest-labs/FLUX.1-dev
|
9 |
+
pipeline_tag: image-to-image
|
10 |
+
tags:
|
11 |
+
- ComfyUI
|
12 |
+
- Inpainting
|
13 |
+
library_name: diffusers
|
14 |
+
---
|
15 |
+
|
16 |
+
<div style="display: flex; justify-content: center; align-items: center;">
|
17 |
+
<img src="https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha/resolve/main/images/alibaba.png" alt="alibaba" style="width: 20%; height: auto; margin-right: 5%;">
|
18 |
+
<img src="https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha/resolve/main/images/alimama.png" alt="alimama" style="width: 20%; height: auto;">
|
19 |
+
</div>
|
20 |
+
|
21 |
+
# FLUX.1-dev ControlNet Inpainting - Beta
|
22 |
+
|
23 |
+
This repository hosts an improved Inpainting ControlNet checkpoint for the [alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha](https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha) model, developed by the AlimamaCreative Team.
|
24 |
+
|
25 |
+
## Key Enhancements
|
26 |
+
|
27 |
+
Our latest inpainting model brings significant improvements compared to the previous version:
|
28 |
+
|
29 |
+
1. **1024 Resolution Support**: Capable of directly processing and generating 1024x1024 resolution images without additional upscaling steps, providing higher quality and more detailed output results.
|
30 |
+
2. **Enhanced Detail Generation**: Fine-tuned to capture and reproduce finer details in inpainted areas.
|
31 |
+
3. **Improved Prompt Control**: Offers more precise control over generated content through enhanced prompt interpretation.
|
32 |
+
|
33 |
+
## Showcase
|
34 |
+
|
35 |
+
The following images were generated using a ComfyUI workflow ([click here to download](https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha/resolve/main/images/alimama-creative-flux-inapint-cn-beta.json)) with these settings:
|
36 |
+
`control-strength` = 1.0, `control-end-percent` = 1.0, `true_cfg` = 1.0
|
37 |
+
|
38 |
+
| Image & Prompt Input | Alpha Version | Beta Version |
|
39 |
+
|-----------------------------------------------------|----------------------------------------------------|----------------------------------------------------|
|
40 |
+
|
41 |
+
<div align = "center">
|
42 |
+
<img src="https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha/resolve/main/images/1_0.png" width = "30%" style="display:inline-block;" />
|
43 |
+
<img src="https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha/resolve/main/images/1_1.png" width = "30%" style="display:inline-block;" />
|
44 |
+
<img src="https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha/resolve/main/images/1_2.png" width = "30%" style="display:inline-block;"/>
|
45 |
+
<br>
|
46 |
+
Prompt : <i>'Write a few lines of words "alimama creative" on the wooden board'</i>
|
47 |
+
</div>
|
48 |
+
|
49 |
+
<div align = "center">
|
50 |
+
<img src="https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha/resolve/main/images/2_0.png" width = "30%" style="display:inline-block;" />
|
51 |
+
<img src="https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha/resolve/main/images/2_1.png" width = "30%" style="display:inline-block;" />
|
52 |
+
<img src="https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha/resolve/main/images/2_2.png" width = "30%" style="display:inline-block;"/>
|
53 |
+
<br>
|
54 |
+
Prompt : <i>"a girl with big beautiful white wing"</i>
|
55 |
+
</div>
|
56 |
+
|
57 |
+
<div align = "center">
|
58 |
+
<img src="https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha/resolve/main/images/3_0.png" width = "30%" style="display:inline-block;" />
|
59 |
+
<img src="https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha/resolve/main/images/3_1.png" width = "30%" style="display:inline-block;" />
|
60 |
+
<img src="https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha/resolve/main/images/3_2.png" width = "30%" style="display:inline-block;"/>
|
61 |
+
<br>
|
62 |
+
Prompt : <i>"red hair"</i>
|
63 |
+
</div>
|
64 |
+
|
65 |
+
<div align = "center">
|
66 |
+
<img src="https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha/resolve/main/images/4_0.png" width = "30%" style="display:inline-block;" />
|
67 |
+
<img src="https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha/resolve/main/images/4_1.png" width = "30%" style="display:inline-block;" />
|
68 |
+
<img src="https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha/resolve/main/images/4_2.png" width = "30%" style="display:inline-block;"/>
|
69 |
+
<br>
|
70 |
+
Prompt : <i>" "</i>
|
71 |
+
</div>
|
72 |
+
|
73 |
+
<div align = "center">
|
74 |
+
<img src="https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha/resolve/main/images/5_0.png" width = "30%" style="display:inline-block;" />
|
75 |
+
<img src="https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha/resolve/main/images/5_1.png" width = "30%" style="display:inline-block;" />
|
76 |
+
<img src="https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha/resolve/main/images/5_2.png" width = "30%" style="display:inline-block;"/>
|
77 |
+
<br>
|
78 |
+
Prompt : <i>"Albert Einstein"</i>
|
79 |
+
</div>
|
80 |
+
|
81 |
+
<div align = "center">
|
82 |
+
<img src="https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha/resolve/main/images/6_0.png" width = "30%" style="display:inline-block;" />
|
83 |
+
<img src="https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha/resolve/main/images/6_1.png" width = "30%" style="display:inline-block;" />
|
84 |
+
<img src="https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha/resolve/main/images/6_2.png" width = "30%" style="display:inline-block;"/>
|
85 |
+
<br>
|
86 |
+
Prompt : <i>"Ravello Outdoor Sectional Sofa Set with Coffee Table"</i>
|
87 |
+
</div>
|
88 |
+
|
89 |
+
### ComfyUI Usage Guidelines:
|
90 |
+
|
91 |
+
Download example ComfyUI workflow [here](https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha/resolve/main/images/alimama-creative-flux-inapint-cn-beta.json).
|
92 |
+
|
93 |
+
- Using `t5xxl-FP16` and `flux1-dev-fp8` models for 30-step inference @1024px & H20 GPU:
|
94 |
+
- GPU memory usage: 27GB
|
95 |
+
- Inference time: 48 seconds (true_cfg=3.5), 26 seconds (true_cfg=1)
|
96 |
+
|
97 |
+
- Different results can be achieved by adjusting the following parameters:
|
98 |
+
|
99 |
+
| Parameter | Recommended Range | Effect |
|
100 |
+
|-----------|------------------|--------|
|
101 |
+
| control-strength | 0.6 - 1.0 | Controls how much influence the ControlNet has on the generation. Higher values result in stronger adherence to the control image. |
|
102 |
+
| controlend-percent | 0.35 - 1.0 | Determines at which step in the denoising process the ControlNet influence ends. Lower values allow for more creative freedom in later steps. |
|
103 |
+
| true-cfg (Classifier-Free Guidance Scale) | 1.0 or 3.5 | Influences how closely the generation follows the prompt. Higher values increase prompt adherence but may reduce image quality. |
|
104 |
+
|
105 |
+
- More comprehensive full-image prompts can lead to better overall results. For example, in addition to describing the area to be repaired, you can also describe the background, atmosphere, and style of the entire image. This approach can make the generated results more harmonious and natural.
|
106 |
+
|
107 |
+
## Diffusers Integration
|
108 |
+
|
109 |
+
1. Install the required diffusers version:
|
110 |
+
```shell
|
111 |
+
pip install diffusers==0.30.2
|
112 |
+
```
|
113 |
+
|
114 |
+
2. Clone this repository:
|
115 |
+
````shell
|
116 |
+
git clone https://github.com/alimama-creative/FLUX-Controlnet-Inpainting.git
|
117 |
+
````
|
118 |
+
|
119 |
+
3. Configure `image_path`, `mask_path`, and `prompt` in `main.py`, then execute:
|
120 |
+
````shell
|
121 |
+
python main.py
|
122 |
+
````
|
123 |
+
|
124 |
+
## Model Specifications
|
125 |
+
|
126 |
+
- Training dataset: 15M images from LAION2B and proprietary sources
|
127 |
+
- Optimal inference resolution: 1024x1024
|
128 |
+
|
129 |
+
## License
|
130 |
+
|
131 |
+
Our model weights are released under the [FLUX.1 [dev]](https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md) Non-Commercial License.
|
config.json
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_class_name": "FluxControlNetModel",
|
3 |
+
"_diffusers_version": "0.30.2",
|
4 |
+
"_name_or_path": "/data/oss_bucket_0/linjinpeng.ljp/exp_flux/r768_bs96_adamw_lr5e-6_bf16_cfg3.5_sin0_dou6_s11/checkpoint-50000",
|
5 |
+
"attention_head_dim": 128,
|
6 |
+
"axes_dims_rope": [
|
7 |
+
16,
|
8 |
+
56,
|
9 |
+
56
|
10 |
+
],
|
11 |
+
"extra_condition_channels": 4,
|
12 |
+
"guidance_embeds": true,
|
13 |
+
"in_channels": 64,
|
14 |
+
"joint_attention_dim": 4096,
|
15 |
+
"num_attention_heads": 24,
|
16 |
+
"num_layers": 6,
|
17 |
+
"num_single_layers": 0,
|
18 |
+
"patch_size": 1,
|
19 |
+
"pooled_projection_dim": 768
|
20 |
+
}
|
diffusion_pytorch_model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ca46c5f7b5de02caee7c069f2aedbf628af8def8578319ceae3be1588d448448
|
3 |
+
size 4281803800
|