Text-to-Image
Diffusers
kIDAa commited on
Commit
d857aba
·
verified ·
1 Parent(s): 4639834

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +73 -0
README.md ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model:
4
+ - black-forest-labs/FLUX.1-dev
5
+ pipeline_tag: text-to-image
6
+ library_name: diffusers
7
+ ---
8
+ # FLUX Aesthetics Enhancement LoRA
9
+
10
+ ## Introduction
11
+
12
+ This is a LoRA model trained for FLUX.1-dev, which enhances the aesthetic quality of images generated by the model. The improvements include, but are not limited to: rich details, beautiful lighting and shadows, aesthetic composition, and clear visuals. This model does not require any trigger words.
13
+
14
+ * Paper: https://arxiv.org/abs/2412.12888
15
+ * Github: https://github.com/modelscope/DiffSynth-Studio
16
+ * Model: [ModelScope](https://www.modelscope.cn/models/DiffSynth-Studio/ArtAug-lora-FLUX.1dev-v1), [HuggingFace](https://huggingface.co/ECNU-CILab/ArtAug-lora-FLUX.1dev-v1)
17
+ * Demo: [ModelScope](https://modelscope.cn/aigc/imageGeneration?tab=advanced&versionId=7228&modelType=LoRA&sdVersion=FLUX_1&modelUrl=modelscope%3A%2F%2FDiffSynth-Studio%2FArtAug-lora-FLUX.1dev-v1%3Frevision%3Dv1.0), HuggingFace (Coming soon)
18
+
19
+ ## Methodology
20
+
21
+ ![](workflow.jpg)
22
+
23
+ The ArtAug project is inspired by reasoning approaches like GPT-o1, which rely on model interaction and self-correction. We developed a framework aimed at enhancing the capabilities of image generation models through interaction with image understanding models. The training process of ArtAug consists of the following steps:
24
+
25
+ 1. **Synthesis-Understanding Interaction**: After generating an image using the image generation model, we employ a multimodal large language model (Qwen2-VL-72B) to analyze the image content and provide suggestions for modifications, which then lead to the regeneration of a higher quality image.
26
+
27
+ 2. **Data Generation and Filtering**: Interactive generation involves long inference times and sometimes produce poor image content. Therefore, we generate a large batch of image pairs offline, filter them, and use them for subsequent training.
28
+
29
+ 3. **Differential Training**: We apply differential training techniques to train a LoRA model, enabling it to learn the differences between images before and after enhancement, rather than directly training on the dataset of enhanced images.
30
+
31
+ 4. **Iterative Enhancement**: The trained LoRA model is fused into the base model, and the entire process is repeated multiple times with the fused model until the interaction algorithm no longer provides significant enhancements. The LoRA models produced in each iteration are combined to produce this final model.
32
+
33
+ This model integrates the aesthetic understanding of Qwen2-VL-72B into FLUX.1[dev], leading to an improvement in the quality of generated images.
34
+
35
+ ## Usage
36
+
37
+ This model is trained using [DiffSynth-Studio](https://github.com/modelscope/DiffSynth-Studio). We recommend users to use DiffSynth-Studio for inference.
38
+
39
+ ```shell
40
+ git clone https://github.com/modelscope/DiffSynth-Studio.git
41
+ cd DiffSynth-Studio
42
+ pip install -e .
43
+ ```
44
+
45
+ ```python
46
+ import torch
47
+ from diffsynth import ModelManager, FluxImagePipeline, download_customized_models
48
+
49
+ lora_path = download_customized_models(
50
+ model_id="DiffSynth-Studio/ArtAug-lora-FLUX.1dev-v1",
51
+ origin_file_path="merged_lora.safetensors",
52
+ local_dir="models/lora"
53
+ )[0]
54
+ model_manager = ModelManager(torch_dtype=torch.bfloat16, device="cuda", model_id_list=["FLUX.1-dev"])
55
+ model_manager.load_lora(lora_path, lora_alpha=1.0)
56
+ pipe = FluxImagePipeline.from_model_manager(model_manager)
57
+
58
+ image = pipe(prompt="a house", seed=0)
59
+ image.save("image_artaug.jpg")
60
+ ```
61
+
62
+ Since this model is encapsulated in the universal FLUX LoRA format, it can be loaded by most LoRA loaders, allowing you to integrate this LoRA model into your own workflow.
63
+
64
+ ## Examples
65
+
66
+ |FLUX.1-dev|FLUX.1-dev + ArtAug LoRA|
67
+ |-|-|
68
+ |![](gallary/image_1_base.jpg)|![](gallary/image_1_enhance.jpg)|
69
+ |![](gallary/image_2_base.jpg)|![](gallary/image_2_enhance.jpg)|
70
+ |![](gallary/image_3_base.jpg)|![](gallary/image_3_enhance.jpg)|
71
+ |![](gallary/image_4_base.jpg)|![](gallary/image_4_enhance.jpg)|
72
+ |![](gallary/image_5_base.jpg)|![](gallary/image_5_enhance.jpg)|
73
+ |![](gallary/image_6_base.jpg)|![](gallary/image_6_enhance.jpg)|