Spaces:
Running
on
Zero
Running
on
Zero
title: FLUX Fast & Furious | |
emoji: πΌπ | |
colorFrom: purple | |
colorTo: red | |
sdk: gradio | |
sdk_version: 5.35.0 | |
app_file: app.py | |
pinned: false | |
license: openrail++ | |
short_description: 'FLUX 8 Step Fast & High Quality Mode' | |
I'll create comprehensive documentation for this FLUX Fast & Furious image generation code in both English and Korean. | |
## English Documentation | |
### FLUX: Fast & Furious - Hyper-Speed Image Generation | |
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. | |
#### Key Features | |
1. **Hyper-Speed Generation** | |
- Utilizes Hyper-SD LoRA (Low-Rank Adaptation) technology from ByteDance | |
- Reduces inference steps from 20-50 to just 6-25 steps (default: 8) | |
- Maintains high image quality while dramatically reducing generation time | |
- Optimized for CUDA with TF32 precision enabled for maximum performance | |
2. **Neon-Themed User Interface** | |
- Custom cyberpunk-inspired design with glowing neon effects | |
- Animated hover effects and dynamic visual feedback | |
- Dark theme with blue, cyan, and magenta color accents | |
- Responsive layout optimized for both desktop and mobile devices | |
3. **User-Friendly Features** | |
- **Example Prompts**: Five pre-written creative prompts covering various genres: | |
- Cyberpunk cityscapes | |
- Fantasy fairy scenes | |
- Epic dragon imagery | |
- Sci-fi space stations | |
- Underwater ancient cities | |
- **Click-to-Use Examples**: Simply click any example to instantly populate the prompt field | |
- **Advanced Settings**: Collapsible panel for fine-tuning generation parameters | |
4. **Customizable Generation Parameters** | |
- **Image Dimensions**: Adjustable width and height (256-1152 pixels) | |
- **Inference Steps**: Control speed vs. quality trade-off (6-25 steps) | |
- **Guidance Scale**: Adjust prompt adherence (0.0-5.0) | |
- **Seed Control**: Reproducible results with manual seed input | |
#### Technical Implementation | |
The application leverages cutting-edge technologies: | |
- **FLUX.1-dev**: State-of-the-art diffusion model from Black Forest Labs | |
- **Hyper-SD LoRA**: ByteDance's acceleration technology achieving 5-10x speedup | |
- **BFloat16 Precision**: Reduced memory usage while maintaining quality | |
- **Gradio Spaces**: GPU-accelerated deployment with automatic resource management | |
- **Custom CSS**: Neon-themed styling with glow effects and animations | |
The generation pipeline: | |
1. Loads the base FLUX.1-dev model in bfloat16 precision | |
2. Applies Hyper-SD LoRA weights with 0.125 scaling factor | |
3. Fuses LoRA weights for optimal performance | |
4. Generates images using accelerated inference with custom parameters | |
5. Outputs high-quality 1024x1024 images (default) in seconds | |
#### Performance Optimization | |
- **GPU Acceleration**: Automatic CUDA optimization with @spaces.GPU decorator | |
- **Memory Efficiency**: BFloat16 precision reduces VRAM usage by 50% | |
- **Inference Mode**: Torch inference mode and autocast for maximum speed | |
- **TF32 Support**: Enabled for compatible GPUs for additional speedup | |
- **Cached Models**: Local model caching to reduce loading times | |
#### Use Cases | |
Perfect for: | |
- Rapid prototyping of visual concepts | |
- Creative exploration with instant feedback | |
- Production of high-quality images for various projects | |
- Testing different artistic styles and compositions | |
- Educational purposes to understand AI image generation | |
--- | |
## νκΈ μ€λͺ μ | |
### FLUX: Fast & Furious - μ΄κ³ μ μ΄λ―Έμ§ μμ±κΈ° | |
μ΄ μ ν리μΌμ΄μ μ ByteDanceμ AutoML νμ΄ κ°λ°ν Hyper-SD κΈ°μ μ νμ©νμ¬ FLUX.1-dev μ΄λ―Έμ§ μμ± λͺ¨λΈμ κ°μνν λ²μ μΌλ‘, κΈ°μ‘΄ 20-50λ¨κ³κ° νμνλ κ³Όμ μ λ¨ 8λ¨κ³λ‘ μ€μ¬ κ³ νμ§ μ΄λ―Έμ§λ₯Ό μμ±ν©λλ€. | |
#### μ£Όμ κΈ°λ₯ | |
1. **μ΄κ³ μ μμ±** | |
- ByteDanceμ Hyper-SD LoRA(Low-Rank Adaptation) κΈ°μ νμ© | |
- μΆλ‘ λ¨κ³λ₯Ό 20-50λ¨κ³μμ 6-25λ¨κ³λ‘ λν μΆμ (κΈ°λ³Έκ°: 8λ¨κ³) | |
- μμ± μκ°μ νκΈ°μ μΌλ‘ λ¨μΆνλ©΄μλ λμ μ΄λ―Έμ§ νμ§ μ μ§ | |
- μ΅λ μ±λ₯μ μν TF32 μ λ°λκ° νμ±νλ CUDA μ΅μ ν | |
2. **λ€μ¨ ν λ§ μ¬μ©μ μΈν°νμ΄μ€** | |
- λ°κ΄ λ€μ¨ ν¨κ³Όκ° μ μ©λ μ¬μ΄λ²νν¬ μ€νμΌμ λ§μΆ€ν λμμΈ | |
- μ λλ©μ΄μ νΈλ² ν¨κ³Όμ λμ μκ° νΌλλ°± | |
- νλμ, μ²λ‘μ, λ§μ ν μμ μ μΌνΈκ° μλ λ€ν¬ ν λ§ | |
- λ°μ€ν¬ν±κ³Ό λͺ¨λ°μΌ κΈ°κΈ° λͺ¨λμ μ΅μ νλ λ°μν λ μ΄μμ | |
3. **μ¬μ©μ μΉνμ κΈ°λ₯** | |
- **μμ ν둬ννΈ**: λ€μν μ₯λ₯΄λ₯Ό λ€λ£¨λ 5κ°μ μ°½μμ μΈ ν둬ννΈ μ 곡: | |
- μ¬μ΄λ²νν¬ λμ νκ²½ | |
- ννμ§ μμ μ₯λ©΄ | |
- μ μ₯ν λλκ³€ μ΄λ―Έμ§ | |
- SF μ°μ£Ό μ κ±°μ₯ | |
- μμ€ κ³ λ λμ | |
- **ν΄λ¦νμ¬ μ¬μ©**: μμλ₯Ό ν΄λ¦νλ©΄ μ¦μ ν둬ννΈ νλμ μ λ ₯ | |
- **κ³ κΈ μ€μ **: μμ± λ§€κ°λ³μ λ―ΈμΈ μ‘°μ μ μν μ μ μ μλ ν¨λ | |
4. **λ§μΆ€ν μμ± λ§€κ°λ³μ** | |
- **μ΄λ―Έμ§ ν¬κΈ°**: μ‘°μ κ°λ₯ν λλΉμ λμ΄ (256-1152 ν½μ ) | |
- **μΆλ‘ λ¨κ³**: μλ λ νμ§ κ· ν μ‘°μ (6-25λ¨κ³) | |
- **κ°μ΄λμ€ μ€μΌμΌ**: ν둬ννΈ μ€μλ μ‘°μ (0.0-5.0) | |
- **μλ μ μ΄**: μλ μλ μ λ ₯μΌλ‘ μ¬ν κ°λ₯ν κ²°κ³Ό | |
#### κΈ°μ μ ꡬν | |
μ ν리μΌμ΄μ μ μ΅μ²¨λ¨ κΈ°μ μ νμ©ν©λλ€: | |
- **FLUX.1-dev**: Black Forest Labsμ μ΅μ νμ° λͺ¨λΈ | |
- **Hyper-SD LoRA**: 5-10λ°° μλ ν₯μμ λ¬μ±νλ ByteDanceμ κ°μ κΈ°μ | |
- **BFloat16 μ λ°λ**: νμ§μ μ μ§νλ©΄μ λ©λͺ¨λ¦¬ μ¬μ©λ κ°μ | |
- **Gradio Spaces**: μλ 리μμ€ κ΄λ¦¬κ° ν¬ν¨λ GPU κ°μ λ°°ν¬ | |
- **컀μ€ν CSS**: λ°κ΄ ν¨κ³Όμ μ λλ©μ΄μ μ΄ μλ λ€μ¨ ν λ§ μ€νμΌλ§ | |
μμ± νμ΄νλΌμΈ: | |
1. bfloat16 μ λ°λλ‘ κΈ°λ³Έ FLUX.1-dev λͺ¨λΈ λ‘λ | |
2. 0.125 μ€μΌμΌλ§ ν©ν°λ‘ Hyper-SD LoRA κ°μ€μΉ μ μ© | |
3. μ΅μ μ±λ₯μ μν LoRA κ°μ€μΉ μ΅ν© | |
4. μ¬μ©μ μ μ λ§€κ°λ³μλ‘ κ°μνλ μΆλ‘ μ μ¬μ©νμ¬ μ΄λ―Έμ§ μμ± | |
5. λͺ μ΄ λ§μ κ³ νμ§ 1024x1024 μ΄λ―Έμ§(κΈ°λ³Έκ°) μΆλ ₯ | |
#### μ±λ₯ μ΅μ ν | |
- **GPU κ°μ**: @spaces.GPU λ°μ½λ μ΄ν°λ‘ μλ CUDA μ΅μ ν | |
- **λ©λͺ¨λ¦¬ ν¨μ¨μ±**: BFloat16 μ λ°λλ‘ VRAM μ¬μ©λ 50% κ°μ | |
- **μΆλ‘ λͺ¨λ**: μ΅λ μλλ₯Ό μν Torch μΆλ‘ λͺ¨λμ μλ μΊμ€νΈ | |
- **TF32 μ§μ**: νΈν GPUμμ μΆκ° μλ ν₯μμ μν΄ νμ±ν | |
- **μΊμλ λͺ¨λΈ**: λ‘λ© μκ° λ¨μΆμ μν λ‘컬 λͺ¨λΈ μΊμ± | |
#### μ¬μ© μ¬λ‘ | |
λ€μκ³Ό κ°μ μ©λμ μ ν©ν©λλ€: | |
- μκ°μ 컨μ μ μ μν νλ‘ν νμ΄ν | |
- μ¦κ°μ μΈ νΌλλ°±μΌλ‘ μ°½μμ νμ | |
- λ€μν νλ‘μ νΈλ₯Ό μν κ³ νμ§ μ΄λ―Έμ§ μ μ | |
- λ€μν μμ μ μ€νμΌκ³Ό κ΅¬μ± ν μ€νΈ | |
- AI μ΄λ―Έμ§ μμ± μ΄ν΄λ₯Ό μν κ΅μ‘ λͺ©μ |