Instructions to use madtune/pixeldit-diffusers with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use madtune/pixeldit-diffusers with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("nvidia/PixelDiT-1300M-1024px", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("madtune/pixeldit-diffusers") 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
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -9,13 +9,17 @@ tags:
|
|
| 9 |
base_model: nvidia/PixelDiT-1300M-1024px
|
| 10 |
---
|
| 11 |
|
| 12 |
-
|
| 13 |
|
| 14 |
-
|
| 15 |
|
| 16 |
-
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
---
|
| 21 |
|
|
@@ -24,7 +28,7 @@ All credit goes to the original authors at NVIDIA. This repo only provides a `Di
|
|
| 24 |
PixelDiT is a 1.3B parameter **pixel-space** diffusion transformer β no VAE, generates images directly in pixel space. Runs on **4GB VRAM**.
|
| 25 |
|
| 26 |
- **Architecture**: MMDiT patch blocks + pixel pathway (PiT blocks)
|
| 27 |
-
- **Text
|
| 28 |
- **Native resolution**: 1024Γ1024
|
| 29 |
- **Sampler**: Flow matching (FlowMatchEulerDiscreteScheduler, shift=4.0)
|
| 30 |
- **Minimum steps**: 45β50 β below 45 produces garbage output
|
|
@@ -46,6 +50,8 @@ python scripts/setup_diffusers_pixeldit.py
|
|
| 46 |
|
| 47 |
## Usage
|
| 48 |
|
|
|
|
|
|
|
| 49 |
```python
|
| 50 |
import torch
|
| 51 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
|
@@ -67,15 +73,53 @@ pipe = PixelDiTPipeline.from_pretrained(
|
|
| 67 |
pipe.enable_model_cpu_offload()
|
| 68 |
|
| 69 |
image = pipe(
|
| 70 |
-
"a
|
| 71 |
-
negative_prompt="blurry,
|
| 72 |
height=1024, width=1024,
|
| 73 |
-
num_inference_steps=50,
|
| 74 |
guidance_scale=7.5,
|
| 75 |
).images[0]
|
| 76 |
image.save("out.jpg")
|
| 77 |
```
|
| 78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
---
|
| 80 |
|
| 81 |
## LoRA fine-tuning
|
|
@@ -92,17 +136,8 @@ model.print_trainable_parameters()
|
|
| 92 |
|
| 93 |
---
|
| 94 |
|
| 95 |
-
## Sample outputs
|
| 96 |
-
|
| 97 |
-
| Prompt | Image |
|
| 98 |
-
|--------|-------|
|
| 99 |
-
| *a viking warrior at sunset* | cinematic, photorealistic |
|
| 100 |
-
| *elemental goddess with fire and ice powers* | epic fantasy, 1024px |
|
| 101 |
-
|
| 102 |
-
---
|
| 103 |
-
|
| 104 |
## Credits
|
| 105 |
|
| 106 |
- **Original model & all credit**: [NVIDIA Research](https://huggingface.co/nvidia/PixelDiT-1300M-1024px)
|
| 107 |
- **Paper**: *PixelDiT: Pixel-Space Diffusion Transformers for Text-to-Image Generation* β NVIDIA
|
| 108 |
-
- **This repo**: unofficial diffusers conversion
|
|
|
|
| 9 |
base_model: nvidia/PixelDiT-1300M-1024px
|
| 10 |
---
|
| 11 |
|
| 12 |
+

|
| 13 |
|
| 14 |
+
# PixelDiT 1.3B β Diffusers-Compatible Pipeline
|
| 15 |
|
| 16 |
+
> **Two RTX 3060s. Infinite Lore. Zero Fear.**
|
| 17 |
|
| 18 |
+
Unofficial HuggingFace diffusers-compatible conversion of NVIDIA's [PixelDiT-1300M-1024px](https://huggingface.co/nvidia/PixelDiT-1300M-1024px) with dual text encoder support (Gemma-2-2B + Qwen3-2B) and ComfyUI integration.
|
| 19 |
+
|
| 20 |
+
All credit for the model architecture and weights goes to NVIDIA Research. This repo provides the pipeline wrapper, Qwen encoder integration, and tooling.
|
| 21 |
+
|
| 22 |
+
> **I do not own this model.** Original weights, architecture, and training are the work of NVIDIA Research.
|
| 23 |
|
| 24 |
---
|
| 25 |
|
|
|
|
| 28 |
PixelDiT is a 1.3B parameter **pixel-space** diffusion transformer β no VAE, generates images directly in pixel space. Runs on **4GB VRAM**.
|
| 29 |
|
| 30 |
- **Architecture**: MMDiT patch blocks + pixel pathway (PiT blocks)
|
| 31 |
+
- **Text encoders**: Gemma-2-2B (photorealistic) or Qwen3-2B (creative/fantasy)
|
| 32 |
- **Native resolution**: 1024Γ1024
|
| 33 |
- **Sampler**: Flow matching (FlowMatchEulerDiscreteScheduler, shift=4.0)
|
| 34 |
- **Minimum steps**: 45β50 β below 45 produces garbage output
|
|
|
|
| 50 |
|
| 51 |
## Usage
|
| 52 |
|
| 53 |
+
### Gemma encoder (photorealistic)
|
| 54 |
+
|
| 55 |
```python
|
| 56 |
import torch
|
| 57 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
|
|
|
| 73 |
pipe.enable_model_cpu_offload()
|
| 74 |
|
| 75 |
image = pipe(
|
| 76 |
+
"a viking warrior on a cliff overlooking the stormy sea at sunset",
|
| 77 |
+
negative_prompt="blurry, low quality, deformed, watermark",
|
| 78 |
height=1024, width=1024,
|
| 79 |
+
num_inference_steps=50,
|
| 80 |
guidance_scale=7.5,
|
| 81 |
).images[0]
|
| 82 |
image.save("out.jpg")
|
| 83 |
```
|
| 84 |
|
| 85 |
+
### Qwen encoder (creative / fantasy / absurd realism)
|
| 86 |
+
|
| 87 |
+
```python
|
| 88 |
+
# pip install -r requirements.txt first
|
| 89 |
+
python generate.py --encoder qwen --proj qwen_proj.pt --prompt "your epic prompt"
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
Qwen excels at complex world-building prompts. The more detail you give it, the better.
|
| 93 |
+
|
| 94 |
+
---
|
| 95 |
+
|
| 96 |
+
## generate.py β Quick Start
|
| 97 |
+
|
| 98 |
+
```bash
|
| 99 |
+
# Gemma (default, photorealistic)
|
| 100 |
+
python generate.py --prompt "a leopard in the jungle, National Geographic"
|
| 101 |
+
|
| 102 |
+
# Qwen (creative, fantasy)
|
| 103 |
+
python generate.py --encoder qwen --proj qwen_proj.pt --cfg 7.5 --steps 50 \
|
| 104 |
+
--prompt "A giant fluffy hamster emperor inside a colossal mechanical battle fortress"
|
| 105 |
+
|
| 106 |
+
# Batch mode (runs all PROMPTS list)
|
| 107 |
+
python generate.py --encoder qwen --proj qwen_proj.pt
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
---
|
| 111 |
+
|
| 112 |
+
## ComfyUI
|
| 113 |
+
|
| 114 |
+
```bash
|
| 115 |
+
ln -s /path/to/pixeldit-diffusers/comfyui_pixeldit /path/to/ComfyUI/custom_nodes/comfyui_pixeldit
|
| 116 |
+
```
|
| 117 |
+
|
| 118 |
+
Three nodes under **PixelDiT** category:
|
| 119 |
+
- **PixelDiT Text Encoder** β load Gemma or swap any compatible encoder
|
| 120 |
+
- **PixelDiT Model Loader** β loads transformer from HF
|
| 121 |
+
- **PixelDiT Sampler** β prompt β image, all params exposed
|
| 122 |
+
|
| 123 |
---
|
| 124 |
|
| 125 |
## LoRA fine-tuning
|
|
|
|
| 136 |
|
| 137 |
---
|
| 138 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
## Credits
|
| 140 |
|
| 141 |
- **Original model & all credit**: [NVIDIA Research](https://huggingface.co/nvidia/PixelDiT-1300M-1024px)
|
| 142 |
- **Paper**: *PixelDiT: Pixel-Space Diffusion Transformers for Text-to-Image Generation* β NVIDIA
|
| 143 |
+
- **This repo**: unofficial diffusers conversion, Qwen integration, and tooling only
|