fantos commited on
Commit
79afe16
Β·
verified Β·
1 Parent(s): b9ef883

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +141 -2
README.md CHANGED
@@ -4,11 +4,150 @@ emoji: πŸ–ΌπŸ†
4
  colorFrom: purple
5
  colorTo: red
6
  sdk: gradio
7
- sdk_version: 5.33.1
8
  app_file: app.py
9
  pinned: false
10
  license: openrail++
11
  short_description: 'FLUX 8 Step Fast & High Quality Mode'
12
  ---
 
13
 
14
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 이미지 생성 이해λ₯Ό μœ„ν•œ ꡐ윑 λͺ©μ 