Spaces:
Running
on
Zero
Running
on
Zero
metadata
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:
- Enter your text prompt describing the desired image
- Adjust width and height for your preferred resolution
- Set guidance scale (higher = closer to prompt)
- Choose number of inference steps (more = better quality, slower)
- Optionally set a seed for reproducible results
- For image-to-image mode, upload an initial image and adjust the noising strength
- 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)
์ฌ์ฉ ๋ฐฉ๋ฒ:
- ์ํ๋ ์ด๋ฏธ์ง๋ฅผ ์ค๋ช ํ๋ ํ ์คํธ ํ๋กฌํํธ ์ ๋ ฅ
- ์ํ๋ ํด์๋์ ๋ง๊ฒ ๋๋น์ ๋์ด ์กฐ์
- ๊ฐ์ด๋์ค ์ค์ผ์ผ ์ค์ (๋์์๋ก ํ๋กฌํํธ์ ๋ ๊ฐ๊น๊ฒ)
- ์ถ๋ก ๋จ๊ณ ์ ์ ํ (๋ง์์๋ก ํ์ง ํฅ์, ์๋ ์ ํ)
- ์ฌํ ๊ฐ๋ฅํ ๊ฒฐ๊ณผ๋ฅผ ์ํด ์ ํ์ ์ผ๋ก ์๋ ์ค์
- ์ด๋ฏธ์ง-์ด๋ฏธ์ง ๋ชจ๋์ ๊ฒฝ์ฐ, ์ด๊ธฐ ์ด๋ฏธ์ง๋ฅผ ์ ๋ก๋ํ๊ณ ๋ ธ์ด์ง ๊ฐ๋ ์กฐ์
- "Generate" ํด๋ฆญํ์ฌ ์ด๋ฏธ์ง ์์ฑ