Spaces:
Running
on
Zero
Running
on
Zero
File size: 3,796 Bytes
343fdaf 32e518c 0e2318f 343fdaf 277c103 343fdaf 60fd701 277c103 343fdaf 6206d0b 343fdaf 6206d0b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
---
title: 3D Style Image Gen R1
emoji: ๐ผ๐
colorFrom: purple
colorTo: red
sdk: gradio
sdk_version: 5.35.0
app_file: app.py
pinned: false
license: openrail++
short_description: '3D Style Image Generator R1: Fast & High Quality Mode'
---
I'll analyze this code and provide explanations in both English and Korean.
## English Explanation
This is a **3D Style Image Generator** application built with Gradio and Hugging Face's Diffusers library. Here's what it does:
### Key Features:
1. **Image Generation**: Uses FLUX.1-dev model with Hyper-SD LoRA for fast, high-quality 3D-style image generation
2. **Korean Translation**: Automatically detects and translates Korean prompts to English using Helsinki-NLP translator
3. **Web Interface**: Clean Gradio interface with customizable generation parameters
4. **Gallery Display**: Shows pre-generated sample images with their prompts
### Technical Components:
- **Model**: FLUX.1-dev with Hyper-SD 8-step LoRA for accelerated inference
- **GPU Acceleration**: Uses CUDA with bfloat16 precision for efficiency
- **Caching**: Implements local model caching to avoid repeated downloads
- **Image Saving**: Automatically saves generated images with timestamps
### User Controls:
- **Prompt Input**: Text description for the desired 3D image
- **Advanced Settings**:
- Image dimensions (256-1152 pixels)
- Inference steps (6-25 steps)
- Guidance scale (0.0-5.0)
- Seed control for reproducibility
### Workflow:
1. User enters a prompt (Korean or English)
2. Korean prompts are automatically translated
3. Prompt is formatted with "wbgmsst, 3D, [prompt], white background"
4. Model generates the image using specified parameters
5. Image is displayed and saved to gallery
---
## ํ๊ธ ์ค๋ช
์ด๊ฒ์ Gradio์ Hugging Face์ Diffusers ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํ์ฌ ๊ตฌ์ถ๋ **3D ์คํ์ผ ์ด๋ฏธ์ง ์์ฑ๊ธฐ** ์ ํ๋ฆฌ์ผ์ด์
์
๋๋ค.
### ์ฃผ์ ๊ธฐ๋ฅ:
1. **์ด๋ฏธ์ง ์์ฑ**: FLUX.1-dev ๋ชจ๋ธ๊ณผ Hyper-SD LoRA๋ฅผ ์ฌ์ฉํ์ฌ ๋น ๋ฅด๊ณ ๊ณ ํ์ง์ 3D ์คํ์ผ ์ด๋ฏธ์ง ์์ฑ
2. **ํ๊ตญ์ด ๋ฒ์ญ**: Helsinki-NLP ๋ฒ์ญ๊ธฐ๋ฅผ ์ฌ์ฉํ์ฌ ํ๊ตญ์ด ํ๋กฌํํธ๋ฅผ ์๋์ผ๋ก ๊ฐ์งํ๊ณ ์์ด๋ก ๋ฒ์ญ
3. **์น ์ธํฐํ์ด์ค**: ์ฌ์ฉ์ ์ ์ ๊ฐ๋ฅํ ์์ฑ ๋งค๊ฐ๋ณ์๊ฐ ์๋ ๊น๋ํ Gradio ์ธํฐํ์ด์ค
4. **๊ฐค๋ฌ๋ฆฌ ํ์**: ๋ฏธ๋ฆฌ ์์ฑ๋ ์ํ ์ด๋ฏธ์ง์ ํด๋น ํ๋กฌํํธ ํ์
### ๊ธฐ์ ์ ๊ตฌ์ฑ์์:
- **๋ชจ๋ธ**: ๊ฐ์ํ๋ ์ถ๋ก ์ ์ํ Hyper-SD 8๋จ๊ณ LoRA๊ฐ ์ ์ฉ๋ FLUX.1-dev
- **GPU ๊ฐ์**: ํจ์จ์ฑ์ ์ํด bfloat16 ์ ๋ฐ๋๋ก CUDA ์ฌ์ฉ
- **์บ์ฑ**: ๋ฐ๋ณต ๋ค์ด๋ก๋๋ฅผ ํผํ๊ธฐ ์ํ ๋ก์ปฌ ๋ชจ๋ธ ์บ์ฑ ๊ตฌํ
- **์ด๋ฏธ์ง ์ ์ฅ**: ์์ฑ๋ ์ด๋ฏธ์ง๋ฅผ ํ์์คํฌํ์ ํจ๊ป ์๋ ์ ์ฅ
### ์ฌ์ฉ์ ์ ์ด ๊ธฐ๋ฅ:
- **ํ๋กฌํํธ ์
๋ ฅ**: ์ํ๋ 3D ์ด๋ฏธ์ง์ ๋ํ ํ
์คํธ ์ค๋ช
- **๊ณ ๊ธ ์ค์ **:
- ์ด๋ฏธ์ง ํฌ๊ธฐ (256-1152 ํฝ์
)
- ์ถ๋ก ๋จ๊ณ (6-25 ๋จ๊ณ)
- ๊ฐ์ด๋์ค ์ค์ผ์ผ (0.0-5.0)
- ์ฌํ์ฑ์ ์ํ ์๋ ์ ์ด
### ์๋ ๊ณผ์ :
1. ์ฌ์ฉ์๊ฐ ํ๋กฌํํธ ์
๋ ฅ (ํ๊ตญ์ด ๋๋ ์์ด)
2. ํ๊ตญ์ด ํ๋กฌํํธ๋ ์๋์ผ๋ก ๋ฒ์ญ๋จ
3. ํ๋กฌํํธ๊ฐ "wbgmsst, 3D, [ํ๋กฌํํธ], white background" ํ์์ผ๋ก ํฌ๋งท๋จ
4. ๋ชจ๋ธ์ด ์ง์ ๋ ๋งค๊ฐ๋ณ์๋ฅผ ์ฌ์ฉํ์ฌ ์ด๋ฏธ์ง ์์ฑ
5. ์ด๋ฏธ์ง๊ฐ ํ์๋๊ณ ๊ฐค๋ฌ๋ฆฌ์ ์ ์ฅ๋จ
### ํน๋ณ ๊ธฐ๋ฅ:
- **ํ๊ตญ์ด ์ง์**: ํ๊ตญ์ด๋ก ํ๋กฌํํธ๋ฅผ ์
๋ ฅํ๋ฉด ์๋์ผ๋ก ์์ด๋ก ๋ฒ์ญ๋์ด ์ฒ๋ฆฌ
- **๋น ๋ฅธ ์์ฑ**: Hyper-SD LoRA๋ฅผ ์ฌ์ฉํ์ฌ 8๋จ๊ณ๋ง์ผ๋ก๋ ๊ณ ํ์ง ์ด๋ฏธ์ง ์์ฑ
- **๊ฐค๋ฌ๋ฆฌ**: ๋ค์ํ ์คํ์ผ์ ์ํ ์ด๋ฏธ์ง๋ฅผ ์ฐธ๊ณ ํ ์ ์๋ ๊ฐค๋ฌ๋ฆฌ ์ ๊ณต
- **์๋ ์ ์ด**: ๋์ผํ ์ด๋ฏธ์ง๋ฅผ ์ฌ์์ฑํ ์ ์๋๋ก ์๋ ๊ฐ ์ ์ด ๊ฐ๋ฅ |