Spaces:
Running
on
Zero
Running
on
Zero
Update README.md
Browse files
README.md
CHANGED
@@ -4,11 +4,150 @@ emoji: πΌπ
|
|
4 |
colorFrom: purple
|
5 |
colorTo: red
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 5.
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: openrail++
|
11 |
short_description: 'FLUX 8 Step Fast & High Quality Mode'
|
12 |
---
|
|
|
13 |
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
colorFrom: purple
|
5 |
colorTo: red
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 5.35.0
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: openrail++
|
11 |
short_description: 'FLUX 8 Step Fast & High Quality Mode'
|
12 |
---
|
13 |
+
I'll create comprehensive documentation for this FLUX Fast & Furious image generation code in both English and Korean.
|
14 |
|
15 |
+
## English Documentation
|
16 |
+
|
17 |
+
### FLUX: Fast & Furious - Hyper-Speed Image Generation
|
18 |
+
|
19 |
+
This application implements an accelerated version of the FLUX.1-dev image generation model, optimized by ByteDance's AutoML team using their Hyper-SD technology to achieve high-quality image generation in just 8 steps instead of the typical 20-50 steps.
|
20 |
+
|
21 |
+
#### Key Features
|
22 |
+
|
23 |
+
1. **Hyper-Speed Generation**
|
24 |
+
- Utilizes Hyper-SD LoRA (Low-Rank Adaptation) technology from ByteDance
|
25 |
+
- Reduces inference steps from 20-50 to just 6-25 steps (default: 8)
|
26 |
+
- Maintains high image quality while dramatically reducing generation time
|
27 |
+
- Optimized for CUDA with TF32 precision enabled for maximum performance
|
28 |
+
|
29 |
+
2. **Neon-Themed User Interface**
|
30 |
+
- Custom cyberpunk-inspired design with glowing neon effects
|
31 |
+
- Animated hover effects and dynamic visual feedback
|
32 |
+
- Dark theme with blue, cyan, and magenta color accents
|
33 |
+
- Responsive layout optimized for both desktop and mobile devices
|
34 |
+
|
35 |
+
3. **User-Friendly Features**
|
36 |
+
- **Example Prompts**: Five pre-written creative prompts covering various genres:
|
37 |
+
- Cyberpunk cityscapes
|
38 |
+
- Fantasy fairy scenes
|
39 |
+
- Epic dragon imagery
|
40 |
+
- Sci-fi space stations
|
41 |
+
- Underwater ancient cities
|
42 |
+
- **Click-to-Use Examples**: Simply click any example to instantly populate the prompt field
|
43 |
+
- **Advanced Settings**: Collapsible panel for fine-tuning generation parameters
|
44 |
+
|
45 |
+
4. **Customizable Generation Parameters**
|
46 |
+
- **Image Dimensions**: Adjustable width and height (256-1152 pixels)
|
47 |
+
- **Inference Steps**: Control speed vs. quality trade-off (6-25 steps)
|
48 |
+
- **Guidance Scale**: Adjust prompt adherence (0.0-5.0)
|
49 |
+
- **Seed Control**: Reproducible results with manual seed input
|
50 |
+
|
51 |
+
#### Technical Implementation
|
52 |
+
|
53 |
+
The application leverages cutting-edge technologies:
|
54 |
+
- **FLUX.1-dev**: State-of-the-art diffusion model from Black Forest Labs
|
55 |
+
- **Hyper-SD LoRA**: ByteDance's acceleration technology achieving 5-10x speedup
|
56 |
+
- **BFloat16 Precision**: Reduced memory usage while maintaining quality
|
57 |
+
- **Gradio Spaces**: GPU-accelerated deployment with automatic resource management
|
58 |
+
- **Custom CSS**: Neon-themed styling with glow effects and animations
|
59 |
+
|
60 |
+
The generation pipeline:
|
61 |
+
1. Loads the base FLUX.1-dev model in bfloat16 precision
|
62 |
+
2. Applies Hyper-SD LoRA weights with 0.125 scaling factor
|
63 |
+
3. Fuses LoRA weights for optimal performance
|
64 |
+
4. Generates images using accelerated inference with custom parameters
|
65 |
+
5. Outputs high-quality 1024x1024 images (default) in seconds
|
66 |
+
|
67 |
+
#### Performance Optimization
|
68 |
+
|
69 |
+
- **GPU Acceleration**: Automatic CUDA optimization with @spaces.GPU decorator
|
70 |
+
- **Memory Efficiency**: BFloat16 precision reduces VRAM usage by 50%
|
71 |
+
- **Inference Mode**: Torch inference mode and autocast for maximum speed
|
72 |
+
- **TF32 Support**: Enabled for compatible GPUs for additional speedup
|
73 |
+
- **Cached Models**: Local model caching to reduce loading times
|
74 |
+
|
75 |
+
#### Use Cases
|
76 |
+
|
77 |
+
Perfect for:
|
78 |
+
- Rapid prototyping of visual concepts
|
79 |
+
- Creative exploration with instant feedback
|
80 |
+
- Production of high-quality images for various projects
|
81 |
+
- Testing different artistic styles and compositions
|
82 |
+
- Educational purposes to understand AI image generation
|
83 |
+
|
84 |
+
---
|
85 |
+
|
86 |
+
## νκΈ μ€λͺ
μ
|
87 |
+
|
88 |
+
### FLUX: Fast & Furious - μ΄κ³ μ μ΄λ―Έμ§ μμ±κΈ°
|
89 |
+
|
90 |
+
μ΄ μ ν리μΌμ΄μ
μ ByteDanceμ AutoML νμ΄ κ°λ°ν Hyper-SD κΈ°μ μ νμ©νμ¬ FLUX.1-dev μ΄λ―Έμ§ μμ± λͺ¨λΈμ κ°μνν λ²μ μΌλ‘, κΈ°μ‘΄ 20-50λ¨κ³κ° νμνλ κ³Όμ μ λ¨ 8λ¨κ³λ‘ μ€μ¬ κ³ νμ§ μ΄λ―Έμ§λ₯Ό μμ±ν©λλ€.
|
91 |
+
|
92 |
+
#### μ£Όμ κΈ°λ₯
|
93 |
+
|
94 |
+
1. **μ΄κ³ μ μμ±**
|
95 |
+
- ByteDanceμ Hyper-SD LoRA(Low-Rank Adaptation) κΈ°μ νμ©
|
96 |
+
- μΆλ‘ λ¨κ³λ₯Ό 20-50λ¨κ³μμ 6-25λ¨κ³λ‘ λν μΆμ (κΈ°λ³Έκ°: 8λ¨κ³)
|
97 |
+
- μμ± μκ°μ νκΈ°μ μΌλ‘ λ¨μΆνλ©΄μλ λμ μ΄λ―Έμ§ νμ§ μ μ§
|
98 |
+
- μ΅λ μ±λ₯μ μν TF32 μ λ°λκ° νμ±νλ CUDA μ΅μ ν
|
99 |
+
|
100 |
+
2. **λ€μ¨ ν
λ§ μ¬μ©μ μΈν°νμ΄μ€**
|
101 |
+
- λ°κ΄ λ€μ¨ ν¨κ³Όκ° μ μ©λ μ¬μ΄λ²νν¬ μ€νμΌμ λ§μΆ€ν λμμΈ
|
102 |
+
- μ λλ©μ΄μ
νΈλ² ν¨κ³Όμ λμ μκ° νΌλλ°±
|
103 |
+
- νλμ, μ²λ‘μ, λ§μ ν μμ μ
μΌνΈκ° μλ λ€ν¬ ν
λ§
|
104 |
+
- λ°μ€ν¬ν±κ³Ό λͺ¨λ°μΌ κΈ°κΈ° λͺ¨λμ μ΅μ νλ λ°μν λ μ΄μμ
|
105 |
+
|
106 |
+
3. **μ¬μ©μ μΉνμ κΈ°λ₯**
|
107 |
+
- **μμ ν둬ννΈ**: λ€μν μ₯λ₯΄λ₯Ό λ€λ£¨λ 5κ°μ μ°½μμ μΈ ν둬ννΈ μ 곡:
|
108 |
+
- μ¬μ΄λ²νν¬ λμ νκ²½
|
109 |
+
- ννμ§ μμ μ₯λ©΄
|
110 |
+
- μ
μ₯ν λλκ³€ μ΄λ―Έμ§
|
111 |
+
- SF μ°μ£Ό μ κ±°μ₯
|
112 |
+
- μμ€ κ³ λ λοΏ½οΏ½οΏ½
|
113 |
+
- **ν΄λ¦νμ¬ μ¬μ©**: μμλ₯Ό ν΄λ¦νλ©΄ μ¦μ ν둬ννΈ νλμ μ
λ ₯
|
114 |
+
- **κ³ κΈ μ€μ **: μμ± λ§€κ°λ³μ λ―ΈμΈ μ‘°μ μ μν μ μ μ μλ ν¨λ
|
115 |
+
|
116 |
+
4. **λ§μΆ€ν μμ± λ§€κ°λ³μ**
|
117 |
+
- **μ΄λ―Έμ§ ν¬κΈ°**: μ‘°μ κ°λ₯ν λλΉμ λμ΄ (256-1152 ν½μ
)
|
118 |
+
- **μΆλ‘ λ¨κ³**: μλ λ νμ§ κ· ν μ‘°μ (6-25λ¨κ³)
|
119 |
+
- **κ°μ΄λμ€ μ€μΌμΌ**: ν둬ννΈ μ€μλ μ‘°μ (0.0-5.0)
|
120 |
+
- **μλ μ μ΄**: μλ μλ μ
λ ₯μΌλ‘ μ¬ν κ°λ₯ν κ²°κ³Ό
|
121 |
+
|
122 |
+
#### κΈ°μ μ ꡬν
|
123 |
+
|
124 |
+
μ ν리μΌμ΄μ
μ μ΅μ²¨λ¨ κΈ°μ μ νμ©ν©λλ€:
|
125 |
+
- **FLUX.1-dev**: Black Forest Labsμ μ΅μ νμ° λͺ¨λΈ
|
126 |
+
- **Hyper-SD LoRA**: 5-10λ°° μλ ν₯μμ λ¬μ±νλ ByteDanceμ κ°μ κΈ°μ
|
127 |
+
- **BFloat16 μ λ°λ**: νμ§μ μ μ§νλ©΄μ λ©λͺ¨λ¦¬ μ¬μ©λ κ°μ
|
128 |
+
- **Gradio Spaces**: μλ 리μμ€ κ΄λ¦¬κ° ν¬ν¨λ GPU κ°μ λ°°ν¬
|
129 |
+
- **컀μ€ν
CSS**: λ°κ΄ ν¨κ³Όμ μ λλ©μ΄μ
μ΄ μλ λ€μ¨ ν
λ§ μ€νμΌλ§
|
130 |
+
|
131 |
+
μμ± νμ΄νλΌμΈ:
|
132 |
+
1. bfloat16 μ λ°λλ‘ κΈ°λ³Έ FLUX.1-dev λͺ¨λΈ λ‘λ
|
133 |
+
2. 0.125 μ€μΌμΌλ§ ν©ν°λ‘ Hyper-SD LoRA κ°μ€μΉ μ μ©
|
134 |
+
3. μ΅μ μ±λ₯μ μν LoRA κ°μ€μΉ μ΅ν©
|
135 |
+
4. μ¬μ©μ μ μ λ§€κ°λ³μλ‘ κ°μνλ μΆλ‘ μ μ¬μ©νμ¬ μ΄λ―Έμ§ μμ±
|
136 |
+
5. λͺ μ΄ λ§μ κ³ νμ§ 1024x1024 μ΄λ―Έμ§(κΈ°λ³Έκ°) μΆλ ₯
|
137 |
+
|
138 |
+
#### μ±λ₯ μ΅μ ν
|
139 |
+
|
140 |
+
- **GPU κ°μ**: @spaces.GPU λ°μ½λ μ΄ν°λ‘ μλ CUDA μ΅μ ν
|
141 |
+
- **λ©λͺ¨λ¦¬ ν¨μ¨μ±**: BFloat16 μ λ°λλ‘ VRAM μ¬μ©λ 50% κ°μ
|
142 |
+
- **μΆλ‘ λͺ¨λ**: μ΅λ μλλ₯Ό μν Torch μΆλ‘ λͺ¨λμ μλ μΊμ€νΈ
|
143 |
+
- **TF32 μ§μ**: νΈν GPUμμ μΆκ° μλ ν₯μμ μν΄ νμ±ν
|
144 |
+
- **μΊμλ λͺ¨λΈ**: λ‘λ© μκ° λ¨μΆμ μν λ‘컬 λͺ¨λΈ μΊμ±
|
145 |
+
|
146 |
+
#### μ¬μ© μ¬λ‘
|
147 |
+
|
148 |
+
λ€μκ³Ό κ°μ μ©λμ μ ν©ν©λλ€:
|
149 |
+
- μκ°μ 컨μ
μ μ μν νλ‘ν νμ΄ν
|
150 |
+
- μ¦κ°μ μΈ νΌλλ°±μΌλ‘ μ°½μμ νμ
|
151 |
+
- λ€μν νλ‘μ νΈλ₯Ό μν κ³ νμ§ μ΄λ―Έμ§ μ μ
|
152 |
+
- λ€μν μμ μ μ€νμΌκ³Ό κ΅¬μ± ν
μ€νΈ
|
153 |
+
- AI μ΄λ―Έμ§ μμ± μ΄ν΄λ₯Ό μν κ΅μ‘ λͺ©μ
|