Spaces:
Running
Running
| title: Rolls-Royce FLUX LoRA | |
| emoji: π | |
| colorFrom: yellow | |
| colorTo: green | |
| sdk: gradio | |
| sdk_version: 5.35.0 | |
| app_file: app.py | |
| pinned: false | |
| I'll create comprehensive documentation for this Flux LoRA Rolls-Royce image generation code in both English and Korean. | |
| ## English Documentation | |
| ### Flux LoRA Rolls-Royce Image Generator | |
| This application is a specialized image generation tool that uses the FLUX.1-dev diffusion model with a custom LoRA (Low-Rank Adaptation) fine-tuned specifically for generating high-quality Rolls-Royce automobile images. | |
| #### Key Features | |
| 1. **Advanced AI Model Integration** | |
| - Utilizes the state-of-the-art FLUX.1-dev diffusion pipeline from Black Forest Labs | |
| - Incorporates a custom LoRA adapter (`seawolf2357/flux-lora-car-rolls-royce`) specifically trained on Rolls-Royce vehicles | |
| - Supports both CUDA GPU acceleration and CPU fallback for broader compatibility | |
| 2. **Persistent Image Storage** | |
| - Automatically saves all generated images with unique timestamps and UUIDs | |
| - Maintains a metadata file tracking prompts and generation times | |
| - Provides a gallery view for browsing previously generated images | |
| 3. **User-Friendly Interface** | |
| - Built with Gradio for an intuitive web-based interface | |
| - Features two main tabs: Generation and Gallery | |
| - Includes pre-written example prompts showcasing various Rolls-Royce models in luxurious settings | |
| 4. **Customizable Generation Parameters** | |
| - **Seed Control**: Option for randomization or manual seed setting for reproducibility | |
| - **Image Dimensions**: Adjustable width and height (up to 1024x1024 pixels) | |
| - **Guidance Scale**: Controls how closely the image follows the prompt (0.0-10.0) | |
| - **Inference Steps**: Number of denoising steps (1-50) | |
| - **LoRA Scale**: Strength of the Rolls-Royce-specific adaptation (0.0-1.0) | |
| #### Technical Implementation | |
| The application leverages several key technologies: | |
| - **PyTorch** for deep learning operations | |
| - **Diffusers** library for the diffusion model pipeline | |
| - **Gradio** for the web interface | |
| - **Spaces GPU** decorator for optimized GPU usage (120-second duration limit) | |
| The generation process: | |
| 1. Loads the base FLUX.1-dev model with bfloat16 precision for memory efficiency | |
| 2. Applies the Rolls-Royce LoRA weights for specialized car generation | |
| 3. Processes user prompts with specified parameters | |
| 4. Saves generated images automatically with metadata | |
| 5. Updates the gallery view with new creations | |
| #### Example Use Cases | |
| The included examples demonstrate various scenarios: | |
| - Classic Rolls-Royce models in architectural settings | |
| - Modern vehicles in urban environments | |
| - Luxury SUVs in natural landscapes | |
| - Vintage cars in historical contexts | |
| - High-performance models in exclusive locations | |
| Each prompt includes the `[trigger]` keyword to activate the LoRA adaptation effectively. | |
| --- | |
| ## νκΈ μ€λͺ μ | |
| ### Flux LoRA λ‘€μ€λ‘μ΄μ€ μ΄λ―Έμ§ μμ±κΈ° | |
| μ΄ μ ν리μΌμ΄μ μ FLUX.1-dev νμ° λͺ¨λΈκ³Ό λ‘€μ€λ‘μ΄μ€ μλμ°¨ μ΄λ―Έμ§ μμ±μ νΉνλ 컀μ€ν LoRA(Low-Rank Adaptation)λ₯Ό μ¬μ©νλ μ λ¬Έ μ΄λ―Έμ§ μμ± λꡬμ λλ€. | |
| #### μ£Όμ κΈ°λ₯ | |
| 1. **κ³ κΈ AI λͺ¨λΈ ν΅ν©** | |
| - Black Forest Labsμ μ΅μ²¨λ¨ FLUX.1-dev νμ° νμ΄νλΌμΈ νμ© | |
| - λ‘€μ€λ‘μ΄μ€ μ°¨λ μ μ©μΌλ‘ νμ΅λ 컀μ€ν LoRA μ΄λν°(`seawolf2357/flux-lora-car-rolls-royce`) μ μ© | |
| - CUDA GPU κ°μ λ° CPU ν΄λ°± μ§μμΌλ‘ νλμ νΈνμ± μ 곡 | |
| 2. **μꡬ μ΄λ―Έμ§ μ μ₯** | |
| - μμ±λ λͺ¨λ μ΄λ―Έμ§λ₯Ό κ³ μ ν νμμ€ν¬νμ UUIDλ‘ μλ μ μ₯ | |
| - ν둬ννΈμ μμ± μκ°μ μΆμ νλ λ©νλ°μ΄ν° νμΌ μ μ§ | |
| - μ΄μ μ μμ±λ μ΄λ―Έμ§λ₯Ό νμν μ μλ κ°€λ¬λ¦¬ λ·° μ 곡 | |
| 3. **μ¬μ©μ μΉνμ μΈν°νμ΄μ€** | |
| - Gradioλ₯Ό μ¬μ©ν μ§κ΄μ μΈ μΉ κΈ°λ° μΈν°νμ΄μ€ κ΅¬μΆ | |
| - μμ±(Generation)κ³Ό κ°€λ¬λ¦¬(Gallery) λ κ°μ μ£Όμ ν μ 곡 | |
| - λ€μν λ‘€μ€λ‘μ΄μ€ λͺ¨λΈμ κ³ κΈμ€λ¬μ΄ νκ²½μμ 보μ¬μ£Όλ μμ ν둬ννΈ ν¬ν¨ | |
| 4. **λ§μΆ€ν μμ± λ§€κ°λ³μ** | |
| - **μλ μ μ΄**: μ¬νμ±μ μν 무μμν λλ μλ μλ μ€μ μ΅μ | |
| - **μ΄λ―Έμ§ ν¬κΈ°**: μ‘°μ κ°λ₯ν λλΉμ λμ΄ (μ΅λ 1024x1024 ν½μ ) | |
| - **κ°μ΄λμ€ μ€μΌμΌ**: ν둬ννΈ μ€μ μ λ μ μ΄ (0.0-10.0) | |
| - **μΆλ‘ λ¨κ³**: λ Έμ΄μ¦ μ κ±° λ¨κ³ μ (1-50) | |
| - **LoRA μ€μΌμΌ**: λ‘€μ€λ‘μ΄μ€ νΉν μ μ κ°λ (0.0-1.0) | |
| #### κΈ°μ μ ꡬν | |
| μ ν리μΌμ΄μ μ λ€μκ³Ό κ°μ ν΅μ¬ κΈ°μ μ νμ©ν©λλ€: | |
| - λ₯λ¬λ μ°μ°μ μν **PyTorch** | |
| - νμ° λͺ¨λΈ νμ΄νλΌμΈμ μν **Diffusers** λΌμ΄λΈλ¬λ¦¬ | |
| - μΉ μΈν°νμ΄μ€λ₯Ό μν **Gradio** | |
| - μ΅μ νλ GPU μ¬μ©μ μν **Spaces GPU** λ°μ½λ μ΄ν° (120μ΄ μκ° μ ν) | |
| μμ± νλ‘μΈμ€: | |
| 1. λ©λͺ¨λ¦¬ ν¨μ¨μ±μ μν΄ bfloat16 μ λ°λλ‘ κΈ°λ³Έ FLUX.1-dev λͺ¨λΈ λ‘λ | |
| 2. μ λ¬Έ μλμ°¨ μμ±μ μν λ‘€μ€λ‘μ΄μ€ LoRA κ°μ€μΉ μ μ© | |
| 3. μ§μ λ λ§€κ°λ³μλ‘ μ¬μ©μ ν둬ννΈ μ²λ¦¬ | |
| 4. μμ±λ μ΄λ―Έμ§λ₯Ό λ©νλ°μ΄ν°μ ν¨κ» μλ μ μ₯ | |
| 5. μλ‘μ΄ μμ±λ¬Όλ‘ κ°€λ¬λ¦¬ λ·° μ λ°μ΄νΈ | |
| #### μ¬μ© μμ | |
| ν¬ν¨λ μμ λ€μ λ€μν μλ리μ€λ₯Ό 보μ¬μ€λλ€: | |
| - 건μΆμ λ°°κ²½μ ν΄λμ λ‘€μ€λ‘μ΄μ€ λͺ¨λΈ | |
| - λμ νκ²½μ νλμ μ°¨λ | |
| - μμ° νκ²½ μμ λμ 리 SUV | |
| - μμ¬μ λ§₯λ½μ λΉν°μ§ μλμ°¨ | |
| - λ μ μ μΈ μ₯μμ κ³ μ±λ₯ λͺ¨λΈ | |
| κ° ν둬ννΈμλ LoRA μ μμ ν¨κ³Όμ μΌλ‘ νμ±ννκΈ° μν `[trigger]` ν€μλκ° ν¬ν¨λμ΄ μμ΅λλ€. | |