Instructions to use redrob-labs/redrob-image with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use redrob-labs/redrob-image with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("redrob-labs/redrob-image", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
File size: 5,456 Bytes
b421b6a | 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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | # Redrob Image
[English](./README.md)
**Redrob Image**๋ [Redrob](https://redrob.io)์ ์คํ์จ์ดํธ ํ์ฐ ๋ชจ๋ธ์ด๊ณ , [์ด์ฅํ (Janghoon Lee)](https://www.janghoonlee.com)๊ฐ ๋ง๋ค์์ต๋๋ค.
Redrob์ ๋น์ ์ AI๋ฅผ ๋ฏผ์ฃผํํ๋ ๊ฒ ๊ฐ์๋ฐ์. ์ด ๋ชจ๋ธ์ [Apache License 2.0](./LICENSE) ์๋์์ ๋ฌด๋ฃ๋ก ์ฐ๊ณ , ์์
์ ์ผ๋ก๋ ์ธ ์ ์์ต๋๋ค.
## ์ ์ด ๋ชจ๋ธ์ธ๊ฐ
- ๋ฒ ์ด์ค๋ณด๋ค ํ์ค์ ์ธ ์ชฝ์ผ๋ก ๋ง์ท์ต๋๋ค. ํผ๋ถ, ๋น, ์ง๊ฐ์ด ๋ซ๊ณ , ํ๋ผ์คํฑํ AI ํผ๋ถ ํฐ๊ฐ ๋ํฉ๋๋ค.
- ์ฌ์ง, ํฌํธ๋ ์ดํธ, ๋ถ์๊ธฐ ์ด๋ฏธ์ง์์ ๊ฐํฉ๋๋ค.
- Turbo ์คํ์ผ ์ํ๋ง์ด๋ผ DiT ๊ธฐ์ค ์ฝ 8์คํ
์
๋๋ค.
- Diffusers๋ก ๊ทธ๋ฅ Python์์ ๋๋ฆฌ๊ฑฐ๋, ComfyUI์์๋ ๋จธ์ง๋ UNET ํ๋๋ก ์๋๋ค.
- Apache-2.0: ์ฌ์ฉ, ์์
์ด์ฉ, ์ฌ๋ฐฐํฌ ๊ฐ๋ฅํฉ๋๋ค.
## ํ๊ณ
์ฝํ๋ ํ
์คํธ๋ ์ฝํฉ๋๋ค. ํ๊ธ, ๋ฐ๋ฐ๋๊ฐ๋ฆฌ, ๋น๋ผํด ์คํฌ๋ฆฝํธ ๋๋ถ๋ถ๋ ํฌํจ๋ฉ๋๋ค. ํ
์คํธ๊ฐ ์ค์ํ ํ๋ฉด์ ๋ค๋ฅธ ๊ฒฝ๋ก๋ก ๋นผ๋ ๊ฒ ๋ง๋ค๊ณ ๋ด
๋๋ค. ๊ทธ๋ํฝ, ์ธ์, ํ์ดํฌ ์ค์ฌ ์์
๋ ์ฌ์ง/ํฌํธ๋ ์ดํธ๋ณด๋ค ์ฝํฉ๋๋ค.
Turbo ์ํ๋ง์ classifier-free guidance ์์ด ๋๋๋ค (`guidance_scale=0` / ComfyUI `cfg 1`). ๊ทธ๋์ **๋ค๊ฑฐํฐ๋ธ ํ๋กฌํํธ๋ ๋ฌด์๋ฉ๋๋ค**. ํผํ๊ณ ์ถ์ ๊ฑด ํฌ์งํฐ๋ธ ์ชฝ์ ๋ฃ์ผ์ธ์.
## ๋น ๋ฅธ ์์ (Diffusers / Python)
์ํฐํ๋ผ์ด์ฆยทํ๋ก๋์
๊ธฐ๋ณธ์
๋๋ค. Hugging Face ์
๋ก๋์ `transformer/`๊ฐ ๋ค์ด๊ฐ ์์ผ๋ฉด, ๊ทธ Diffusers transformer๋ฅผ ๋ก๋ํ๊ณ ํ
์คํธ ์ธ์ฝ๋ / VAE๋ ๋ฒ ์ด์ค ํ์ดํ๋ผ์ธ์์ ๊ฐ์ ธ์ต๋๋ค.
```bash
pip install -U torch transformers accelerate safetensors
pip install -U diffusers
```
```python
import torch
from diffusers import ZImagePipeline, ZImageTransformer2DModel
transformer = ZImageTransformer2DModel.from_pretrained(
"redrob-labs/redrob-image",
subfolder="transformer",
torch_dtype=torch.bfloat16,
)
pipe = ZImagePipeline.from_pretrained(
"Tongyi-MAI/Z-Image-Turbo",
transformer=transformer,
torch_dtype=torch.bfloat16,
)
pipe.to("cuda")
prompt = "A documentary portrait in natural window light, shallow depth of field"
image = pipe(
prompt=prompt,
height=1024,
width=1024,
num_inference_steps=9, # DiT forward 8ํ
guidance_scale=0.0, # Turbo์์ ํ์
generator=torch.Generator("cuda").manual_seed(42),
).images[0]
image.save("redrob-image.png")
```
์์ GPU๋ฉด `pipe.enable_model_cpu_offload()`๋ฅผ ์ฐ๋ฉด ๋ฉ๋๋ค.
## ๋น ๋ฅธ ์์ (ComfyUI)
| ํ์ผ | ์์น | ์ถ์ฒ |
| --------------------------------- | -------------------------- | ------------------------------------------------------------------------- |
| `redrob-image.safetensors` | `models/diffusion_models/` | ์ด ์ ์ฅ์ |
| `qwen_3_4b_fp8_mixed.safetensors` | `models/text_encoders/` | [Comfy-Org/z_image_turbo](https://huggingface.co/Comfy-Org/z_image_turbo) |
| `ae.safetensors` | `models/vae/` | ๊ฐ์ Comfy-Org ํฉ |
1. `UNETLoader` -> `redrob-image.safetensors`
2. `CLIPLoader` -> `qwen_3_4b_fp8_mixed.safetensors` (`type: lumina2`)
3. `VAELoader` -> `ae.safetensors`
4. ์ํ๋ฌ: **8 steps**, **cfg 1**, `res_multistep` / `sgm_uniform`
์ต์ ๊ทธ๋ํ๋ `workflows/redrob-image-api.json`์
๋๋ค. ๋ค๊ฑฐํฐ๋ธ ์ปจ๋์
๋์ `ConditioningZeroOut`์ผ๋ก ๋น์๋๋ค. ๋ค๊ฑฐํฐ๋ธ ํ
์คํธ๊ฐ ์ด๋ฏธ์ง๋ฅผ ๋ฐ๊ฟ ๊ฑฐ๋ผ๊ณ ๊ธฐ๋ํ์ง ๋ง์ธ์.
## ํ์ผ
| ๊ฒฝ๋ก | ์ญํ |
| --------------------------------- | ------------------------------------- |
| `redrob-image.safetensors` | ComfyUI ๋จธ์ง UNET (LFS, ~12 GiB) |
| `transformer/` | Diffusers ๋ ์ด์์ (HF ์
๋ก๋ ์ ์์ฑ) |
| `workflows/redrob-image-api.json` | ์ต์ ComfyUI API ๊ทธ๋ํ |
| `README.md` / `README.ko.md` | ๋ชจ๋ธ ์นด๋ (์์ด / ํ๊ตญ์ด) |
| `LICENSE` | Apache License 2.0 |
| `NOTICE` | ์ถ์ฒ ํ๊ธฐ |
`transformer/`๋ git์ ์์ต๋๋ค. Hugging Face ์
๋ก๋ ๋ `scripts/push_hf.sh`๊ฐ Comfy UNET์ Diffusers ํฌ๋งท์ผ๋ก ๋ณํํ๊ฑฐ๋, ๋ฏธ๋ฆฌ ๋ง๋ `TRANSFORMER_DIR`์ ๋ณต์ฌํฉ๋๋ค.
๋ก์ปฌ์์ Comfy UNET์ ์ง์ ๋ณํํ๋ ค๋ฉด:
```bash
python scripts/comfy_to_diffusers_zimage.py \
--input redrob-image.safetensors \
--output-dir transformer/
```
## ๋ผ์ด์ ์ค
[Apache License 2.0](./LICENSE). ์ ์๊ถ์ [Redrob](https://redrob.io). ์ ์์ [์ด์ฅํ (Janghoon Lee)](https://www.janghoonlee.com). ์
์คํธ๋ฆผ ํ๊ธฐ๋ [NOTICE](./NOTICE). ์ฌ๋ฐฐํฌํ ๋๋ NOTICE๋ฅผ ๊ฐ์ค์น์ ํจ๊ป ์ ์งํ์ธ์.
## ์ ์ / ์ถ์ฒ
- **์ ์๊ถ:** Redrob ([redrob.io](https://redrob.io))
- **์ ์:** [์ด์ฅํ (Janghoon Lee)](https://www.janghoonlee.com) ([@savagemanage](https://github.com/savagemanage))
- **์ ์ฅ์:** [redrob-labs/redrob-image](https://huggingface.co/redrob-labs/redrob-image)
- **๋ฒ ์ด์ค:** [Tongyi-MAI/Z-Image-Turbo](https://huggingface.co/Tongyi-MAI/Z-Image-Turbo) - Apache License 2.0
|