File size: 3,797 Bytes
5745e9a 4f33d44 a1f3538 5745e9a 2ef7034 5745e9a 36a6494 5745e9a 2ef7034 |
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 |
---
title: FLUXllama
emoji: ๐ฆ๐๐ฆ
colorFrom: gray
colorTo: pink
sdk: gradio
sdk_version: 5.35.0
app_file: app.py
pinned: false
license: mit
short_description: mcp_server & FLUX 4-bit Quantization(just 8GB VRAM)
---
## English Description
### FluxLLama - NF4 Quantized FLUX.1-dev Image Generator
FluxLLama is an optimized implementation of the FLUX.1-dev model using 4-bit quantization (NF4) for efficient GPU memory usage. This application allows you to generate high-quality images from text prompts while using significantly less VRAM than the full-precision model.
#### Key Features:
- **4-bit NF4 Quantization**: Reduces model size from ~24GB to ~6GB VRAM requirement
- **Text-to-Image Generation**: Create images from detailed text descriptions
- **Image-to-Image Generation**: Transform existing images based on text prompts
- **Customizable Parameters**: Control image dimensions, guidance scale, inference steps, and seed
- **Efficient Memory Usage**: Uses bitsandbytes for optimized 4-bit operations
- **Web Interface**: Easy-to-use Gradio interface for image generation
#### Technical Details:
- Uses T5-XXL encoder for text understanding
- CLIP encoder for additional text conditioning
- Custom NF4 (Normal Float 4-bit) quantization implementation
- Supports resolutions from 128x128 to 2048x2048
- Adjustable inference steps (1-30) for quality/speed tradeoff
- Guidance scale control (1.0-5.0) for prompt adherence
#### How to Use:
1. Enter your text prompt describing the desired image
2. Adjust width and height for your preferred resolution
3. Set guidance scale (higher = closer to prompt)
4. Choose number of inference steps (more = better quality, slower)
5. Optionally set a seed for reproducible results
6. For image-to-image mode, upload an initial image and adjust the noising strength
7. Click "Generate" to create your image
---
## ํ๊ธ ์ค๋ช
### FluxLLama - NF4 ์์ํ FLUX.1-dev ์ด๋ฏธ์ง ์์ฑ๊ธฐ
FluxLLama๋ ํจ์จ์ ์ธ GPU ๋ฉ๋ชจ๋ฆฌ ์ฌ์ฉ์ ์ํด 4๋นํธ ์์ํ(NF4)๋ฅผ ์ฌ์ฉํ๋ FLUX.1-dev ๋ชจ๋ธ์ ์ต์ ํ๋ ๊ตฌํ์
๋๋ค. ์ด ์ ํ๋ฆฌ์ผ์ด์
์ ์ฌ์ฉํ๋ฉด ์ ์ฒด ์ ๋ฐ๋ ๋ชจ๋ธ๋ณด๋ค ํจ์ฌ ์ ์ VRAM์ ์ฌ์ฉํ๋ฉด์๋ ํ
์คํธ ํ๋กฌํํธ๋ก๋ถํฐ ๊ณ ํ์ง ์ด๋ฏธ์ง๋ฅผ ์์ฑํ ์ ์์ต๋๋ค.
#### ์ฃผ์ ๊ธฐ๋ฅ:
- **4๋นํธ NF4 ์์ํ**: ๋ชจ๋ธ ํฌ๊ธฐ๋ฅผ ~24GB์์ ~6GB VRAM ์๊ตฌ์ฌํญ์ผ๋ก ๊ฐ์
- **ํ
์คํธ-์ด๋ฏธ์ง ์์ฑ**: ์์ธํ ํ
์คํธ ์ค๋ช
์ผ๋ก๋ถํฐ ์ด๋ฏธ์ง ์์ฑ
- **์ด๋ฏธ์ง-์ด๋ฏธ์ง ์์ฑ**: ํ
์คํธ ํ๋กฌํํธ๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ๊ธฐ์กด ์ด๋ฏธ์ง ๋ณํ
- **์ฌ์ฉ์ ์ ์ ๊ฐ๋ฅํ ๋งค๊ฐ๋ณ์**: ์ด๋ฏธ์ง ํฌ๊ธฐ, ๊ฐ์ด๋์ค ์ค์ผ์ผ, ์ถ๋ก ๋จ๊ณ, ์๋ ์ ์ด
- **ํจ์จ์ ์ธ ๋ฉ๋ชจ๋ฆฌ ์ฌ์ฉ**: ์ต์ ํ๋ 4๋นํธ ์ฐ์ฐ์ ์ํ bitsandbytes ์ฌ์ฉ
- **์น ์ธํฐํ์ด์ค**: ์ด๋ฏธ์ง ์์ฑ์ ์ํ ์ฌ์ฉํ๊ธฐ ์ฌ์ด Gradio ์ธํฐํ์ด์ค
#### ๊ธฐ์ ์ ์ธ๋ถ์ฌํญ:
- ํ
์คํธ ์ดํด๋ฅผ ์ํ T5-XXL ์ธ์ฝ๋ ์ฌ์ฉ
- ์ถ๊ฐ ํ
์คํธ ์กฐ๊ฑดํ๋ฅผ ์ํ CLIP ์ธ์ฝ๋
- ์ปค์คํ
NF4 (Normal Float 4๋นํธ) ์์ํ ๊ตฌํ
- 128x128๋ถํฐ 2048x2048๊น์ง์ ํด์๋ ์ง์
- ํ์ง/์๋ ๊ท ํ์ ์ํ ์กฐ์ ๊ฐ๋ฅํ ์ถ๋ก ๋จ๊ณ (1-30)
- ํ๋กฌํํธ ์ค์๋ฅผ ์ํ ๊ฐ์ด๋์ค ์ค์ผ์ผ ์ ์ด (1.0-5.0)
#### ์ฌ์ฉ ๋ฐฉ๋ฒ:
1. ์ํ๋ ์ด๋ฏธ์ง๋ฅผ ์ค๋ช
ํ๋ ํ
์คํธ ํ๋กฌํํธ ์
๋ ฅ
2. ์ํ๋ ํด์๋์ ๋ง๊ฒ ๋๋น์ ๋์ด ์กฐ์
3. ๊ฐ์ด๋์ค ์ค์ผ์ผ ์ค์ (๋์์๋ก ํ๋กฌํํธ์ ๋ ๊ฐ๊น๊ฒ)
4. ์ถ๋ก ๋จ๊ณ ์ ์ ํ (๋ง์์๋ก ํ์ง ํฅ์, ์๋ ์ ํ)
5. ์ฌํ ๊ฐ๋ฅํ ๊ฒฐ๊ณผ๋ฅผ ์ํด ์ ํ์ ์ผ๋ก ์๋ ์ค์
6. ์ด๋ฏธ์ง-์ด๋ฏธ์ง ๋ชจ๋์ ๊ฒฝ์ฐ, ์ด๊ธฐ ์ด๋ฏธ์ง๋ฅผ ์
๋ก๋ํ๊ณ ๋
ธ์ด์ง ๊ฐ๋ ์กฐ์
7. "Generate" ํด๋ฆญํ์ฌ ์ด๋ฏธ์ง ์์ฑ |