madtune commited on
Commit
17fb275
Β·
verified Β·
1 Parent(s): 50e9bfe

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +53 -18
README.md CHANGED
@@ -9,13 +9,17 @@ tags:
9
  base_model: nvidia/PixelDiT-1300M-1024px
10
  ---
11
 
12
- # PixelDiT 1.3B β€” Diffusers-Compatible Conversion
13
 
14
- This is an **unofficial** HuggingFace diffusers-compatible conversion of NVIDIA's [PixelDiT-1300M-1024px](https://huggingface.co/nvidia/PixelDiT-1300M-1024px).
15
 
16
- All credit goes to the original authors at NVIDIA. This repo only provides a `DiffusionPipeline` wrapper to enable standard diffusers usage, `from_pretrained`, and LoRA fine-tuning via `peft`.
17
 
18
- > **I do not own this model.** Original weights, architecture, and training are the work of NVIDIA Research. Please refer to their [original repository](https://huggingface.co/nvidia/PixelDiT-1300M-1024px) for license terms.
 
 
 
 
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 encoder**: Gemma-2-2B with chi_prompt instruction prefix
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 white horse galloping through a meadow at sunset, cinematic lighting",
71
- negative_prompt="blurry, flat, low quality, cartoon",
72
  height=1024, width=1024,
73
- num_inference_steps=50, # minimum 45 β€” below that produces garbage
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 only, no claim of authorship
 
9
  base_model: nvidia/PixelDiT-1300M-1024px
10
  ---
11
 
12
+ ![FourNeuron-PixelDiT Banner](assets/banner.png)
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