Duplicate from alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Beta
Browse files- .gitattributes +35 -0
- README.md +137 -0
- README_ZH.md +116 -0
- config.json +20 -0
- diffusion_pytorch_model.safetensors +3 -0
.gitattributes
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
[中文版Readme](https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Beta/blob/main/README_ZH.md)
|
| 22 |
+
|
| 23 |
+
# FLUX.1-dev ControlNet Inpainting - Beta
|
| 24 |
+
|
| 25 |
+
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.
|
| 26 |
+
|
| 27 |
+
## 🔥News!
|
| 28 |
+
|
| 29 |
+
- **[2024.10.16]** We release a 8-step FLUX.1 distilled lora [alimama-creative/FLUX.1-Turbo-Alpha](https://huggingface.co/alimama-creative/FLUX.1-Turbo-Alpha), which is compatible with our Inpainting Controlnet.
|
| 30 |
+
|
| 31 |
+
## Key Enhancements
|
| 32 |
+
|
| 33 |
+
Our latest inpainting model brings significant improvements compared to the previous version:
|
| 34 |
+
|
| 35 |
+
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.
|
| 36 |
+
2. **Enhanced Detail Generation**: Fine-tuned to capture and reproduce finer details in inpainted areas.
|
| 37 |
+
3. **Improved Prompt Control**: Offers more precise control over generated content through enhanced prompt interpretation.
|
| 38 |
+
|
| 39 |
+
## Showcase
|
| 40 |
+
|
| 41 |
+
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:
|
| 42 |
+
`control-strength` = 1.0, `control-end-percent` = 1.0, `true_cfg` = 1.0
|
| 43 |
+
|
| 44 |
+
| Image & Prompt Input | Alpha Version | Beta Version |
|
| 45 |
+
|-----------------------------------------------------|----------------------------------------------------|----------------------------------------------------|
|
| 46 |
+
|
| 47 |
+
<div align = "center">
|
| 48 |
+
<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;" />
|
| 49 |
+
<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;" />
|
| 50 |
+
<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;"/>
|
| 51 |
+
<br>
|
| 52 |
+
Prompt : <i>'Write a few lines of words "alimama creative" on the wooden board'</i>
|
| 53 |
+
</div>
|
| 54 |
+
|
| 55 |
+
<div align = "center">
|
| 56 |
+
<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;" />
|
| 57 |
+
<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;" />
|
| 58 |
+
<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;"/>
|
| 59 |
+
<br>
|
| 60 |
+
Prompt : <i>"a girl with big beautiful white wing"</i>
|
| 61 |
+
</div>
|
| 62 |
+
|
| 63 |
+
<div align = "center">
|
| 64 |
+
<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;" />
|
| 65 |
+
<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;" />
|
| 66 |
+
<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;"/>
|
| 67 |
+
<br>
|
| 68 |
+
Prompt : <i>"red hair"</i>
|
| 69 |
+
</div>
|
| 70 |
+
|
| 71 |
+
<div align = "center">
|
| 72 |
+
<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;" />
|
| 73 |
+
<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;" />
|
| 74 |
+
<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;"/>
|
| 75 |
+
<br>
|
| 76 |
+
Prompt : <i>" "</i>
|
| 77 |
+
</div>
|
| 78 |
+
|
| 79 |
+
<div align = "center">
|
| 80 |
+
<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;" />
|
| 81 |
+
<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;" />
|
| 82 |
+
<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;"/>
|
| 83 |
+
<br>
|
| 84 |
+
Prompt : <i>"Albert Einstein"</i>
|
| 85 |
+
</div>
|
| 86 |
+
|
| 87 |
+
<div align = "center">
|
| 88 |
+
<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;" />
|
| 89 |
+
<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;" />
|
| 90 |
+
<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;"/>
|
| 91 |
+
<br>
|
| 92 |
+
Prompt : <i>"Ravello Outdoor Sectional Sofa Set with Coffee Table"</i>
|
| 93 |
+
</div>
|
| 94 |
+
|
| 95 |
+
### ComfyUI Usage Guidelines:
|
| 96 |
+
|
| 97 |
+
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).
|
| 98 |
+
|
| 99 |
+
- Using `t5xxl-FP16` and `flux1-dev-fp8` models for 30-step inference @1024px & H20 GPU:
|
| 100 |
+
- GPU memory usage: 27GB
|
| 101 |
+
- Inference time: 48 seconds (true_cfg=3.5), 26 seconds (true_cfg=1)
|
| 102 |
+
|
| 103 |
+
- Different results can be achieved by adjusting the following parameters:
|
| 104 |
+
|
| 105 |
+
| Parameter | Recommended Range | Effect |
|
| 106 |
+
|-----------|------------------|--------|
|
| 107 |
+
| 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. |
|
| 108 |
+
| 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. |
|
| 109 |
+
| 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. |
|
| 110 |
+
|
| 111 |
+
- 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.
|
| 112 |
+
|
| 113 |
+
## Diffusers Integration
|
| 114 |
+
|
| 115 |
+
1. Install the required diffusers version:
|
| 116 |
+
```shell
|
| 117 |
+
pip install diffusers==0.30.2
|
| 118 |
+
```
|
| 119 |
+
|
| 120 |
+
2. Clone this repository:
|
| 121 |
+
````shell
|
| 122 |
+
git clone https://github.com/alimama-creative/FLUX-Controlnet-Inpainting.git
|
| 123 |
+
````
|
| 124 |
+
|
| 125 |
+
3. Configure `image_path`, `mask_path`, and `prompt` in `main.py`, then execute:
|
| 126 |
+
````shell
|
| 127 |
+
python main.py
|
| 128 |
+
````
|
| 129 |
+
|
| 130 |
+
## Model Specifications
|
| 131 |
+
|
| 132 |
+
- Training dataset: 15M images from LAION2B and proprietary sources
|
| 133 |
+
- Optimal inference resolution: 1024x1024
|
| 134 |
+
|
| 135 |
+
## License
|
| 136 |
+
|
| 137 |
+
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.
|
README_ZH.md
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<div style="display: flex; justify-content: center; align-items: center;">
|
| 2 |
+
<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%;">
|
| 3 |
+
<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;">
|
| 4 |
+
</div>
|
| 5 |
+
|
| 6 |
+
# FLUX.1-dev ControlNet 图像修复 - Beta版
|
| 7 |
+
|
| 8 |
+
本仓库包含了由阿里妈妈创意团队开发的[alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha](https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha)模型的改进版图像修复ControlNet权重和推理代码。
|
| 9 |
+
|
| 10 |
+
## 主要改进
|
| 11 |
+
|
| 12 |
+
与之前版本相比,我们最新的图像修复模型带来了以下改进:
|
| 13 |
+
|
| 14 |
+
1. **支持1024分辨率**: 能够直接处理和生成1024x1024分辨率的图像,无需额外的放大步骤,提供更高质量和更详细的输出结果。
|
| 15 |
+
2. **增强细节生成**: 经过微调以捕捉和重现修复区域的更精细细节。
|
| 16 |
+
3. **改进提示词控制**: 通过增强的提示词解释,对生成内容提供更精确的控制。
|
| 17 |
+
|
| 18 |
+
## 展示示例
|
| 19 |
+
|
| 20 |
+
以下图像是使用ComfyUI工作流生成的([点击此处下载](https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha/resolve/main/images/alimama-creative-flux-inapint-cn-beta.json)),设置如下:
|
| 21 |
+
`control-strength` = 1.0, `control-end-percent` = 1.0, `true_cfg` = 1.0
|
| 22 |
+
|
| 23 |
+
| 图像 & 提示词输入 | Alpha 版本 | Beta 版本 |
|
| 24 |
+
|-----------------------------------------------------|----------------------------------------------------|----------------------------------------------------|
|
| 25 |
+
|
| 26 |
+
<div align = "center">
|
| 27 |
+
<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;" />
|
| 28 |
+
<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;" />
|
| 29 |
+
<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;"/>
|
| 30 |
+
<br>
|
| 31 |
+
提示词 : <i>'在木板上写几行"alimama creative"字样'</i>
|
| 32 |
+
</div>
|
| 33 |
+
|
| 34 |
+
<div align = "center">
|
| 35 |
+
<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;" />
|
| 36 |
+
<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;" />
|
| 37 |
+
<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;"/>
|
| 38 |
+
<br>
|
| 39 |
+
提示词 : <i>"一个女孩,有漂亮的大白翅膀"</i>
|
| 40 |
+
</div>
|
| 41 |
+
|
| 42 |
+
<div align = "center">
|
| 43 |
+
<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;" />
|
| 44 |
+
<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;" />
|
| 45 |
+
<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;"/>
|
| 46 |
+
<br>
|
| 47 |
+
提示词 : <i>"红色头发"</i>
|
| 48 |
+
</div>
|
| 49 |
+
|
| 50 |
+
<div align = "center">
|
| 51 |
+
<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;" />
|
| 52 |
+
<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;" />
|
| 53 |
+
<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;"/>
|
| 54 |
+
<br>
|
| 55 |
+
提示词 : <i>" "</i>
|
| 56 |
+
</div>
|
| 57 |
+
|
| 58 |
+
<div align = "center">
|
| 59 |
+
<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;" />
|
| 60 |
+
<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;" />
|
| 61 |
+
<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;"/>
|
| 62 |
+
<br>
|
| 63 |
+
提示词 : <i>"阿尔伯特·爱因斯坦"</i>
|
| 64 |
+
</div>
|
| 65 |
+
|
| 66 |
+
<div align = "center">
|
| 67 |
+
<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;" />
|
| 68 |
+
<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;" />
|
| 69 |
+
<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;"/>
|
| 70 |
+
<br>
|
| 71 |
+
提示词 : <i>"Ravello户外沙发组合配咖啡桌"</i>
|
| 72 |
+
</div>
|
| 73 |
+
|
| 74 |
+
### ComfyUI使用指南:
|
| 75 |
+
|
| 76 |
+
下载示例ComfyUI工作流[点击这里](https://huggingface.co/alimama-creative/FLUX.1-dev-Controlnet-Inpainting-Alpha/resolve/main/images/alimama-creative-flux-inapint-cn-beta.json)。
|
| 77 |
+
|
| 78 |
+
- 使用`t5xxl-FP16`和`flux1-dev-fp8`模型进行30步推理@1024px & H20 GPU:
|
| 79 |
+
- GPU内存使用: 27GB
|
| 80 |
+
- 推理时间: 48秒 (true_cfg=3.5), 26秒 (true_cfg=1)
|
| 81 |
+
|
| 82 |
+
- 通过调整以下参数可以获得不同的结果:
|
| 83 |
+
|
| 84 |
+
| 参数 | 推荐范围 | 效果 |
|
| 85 |
+
|-----------|------------------|--------|
|
| 86 |
+
| control-strength | 0.6 - 1.0 | 控制ControlNet对生成的影响程度。较高的值会使生成结果更严格地遵循控制图像。 |
|
| 87 |
+
| controlend-percent | 0.35 - 1.0 | 决定ControlNet影响在去噪过程中的哪一步结束。较低的值在后期步骤中允许更多的创意自由。 |
|
| 88 |
+
| true-cfg (无分类器引导尺度) | 1.0 或 3.5 | 影响生成结果对提示词的遵循程度。较高的值会增加对提示词的遵循,但可能降低图像质量。 |
|
| 89 |
+
|
| 90 |
+
- 更全面的整图提示词可以带来更好的整体效果。例如,除了描述需要修复的区域,你还可以描述整个图像的背景、氛围和风格。这种方法可以使生成的结果更加和谐自然。
|
| 91 |
+
|
| 92 |
+
## Diffusers 推理
|
| 93 |
+
|
| 94 |
+
1. 安装所需的diffusers版本:
|
| 95 |
+
```shell
|
| 96 |
+
pip install diffusers==0.30.2
|
| 97 |
+
```
|
| 98 |
+
|
| 99 |
+
2. 克隆此仓库:
|
| 100 |
+
```shell
|
| 101 |
+
git clone https://github.com/alimama-creative/FLUX-Controlnet-Inpainting.git
|
| 102 |
+
```
|
| 103 |
+
|
| 104 |
+
3. 在`main.py`中配置`image_path`、`mask_path`和`prompt`,然后执行:
|
| 105 |
+
```shell
|
| 106 |
+
python main.py
|
| 107 |
+
```
|
| 108 |
+
|
| 109 |
+
## 模型说明
|
| 110 |
+
|
| 111 |
+
- 训练数据集: 来自LAION2B和专有来源的1500万张图像
|
| 112 |
+
- 最佳推理分辨率: 1024x1024
|
| 113 |
+
|
| 114 |
+
## 许可证
|
| 115 |
+
|
| 116 |
+
我们的模型权重在[FLUX.1 [dev]](https://huggingface.co/black-forest-labs/FLUX.1-dev/blob/main/LICENSE.md)非商业许可下发布。
|
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
|