ComfyUI-PJiT: Linum's P-JiT 21K natively in ComfyUI

ComfyUI v0.44+ VRAM from 4 GB Apache-2.0

Nodes on GitHub · The original model · Linum's blog post

P-JiT 21K by Linum, as bf16 and int8 files for ComfyUI. P-JiT is a 2B-parameter text-to-image model that draws directly in pixels, with no VAE. With the ComfyUI-PJiT nodes it runs on ComfyUI's own KSampler and memory management, from 4 GB of free VRAM.

Seven P-JiT images: a panda in a bamboo grove, a Scandinavian reading nook, a bowl of ramen, a Mediterranean street after rain, an elderly woman in a headscarf, a lighthouse at sunset and a hot-air balloon over fields at sunrise

pjit_21k_bf16 · 50 steps, euler, cfg 15 · RTX 3090 · nook, ramen, street, lighthouse and balloon: our captions, seed 42 · panda and portrait: Linum's sample captions with their seeds and noise

Files

The model, for ComfyUI/models/diffusion_models:

Model Size
pjit_21k_bf16 4.37 GB the same pixels as Linum's fp32 release, at half the size
pjit_21k_int8_convrot 2.33 GB about 1.8x faster on GPUs with int8 kernels, other fine detail

The text encoder, Qwen3.5-4B, for ComfyUI/models/text_encoders. bf16 is Comfy-Org's file; the smaller ones are here:

Text encoder Size Caption embeddings against bf16
qwen3.5_4b_bf16 9.32 GB as released
qwen3.5_4b_int8_convrot 4.72 GB 2 % off
qwen3.5_4b_w6a8 4.05 GB 4 to 5 % off
qwen3.5_4b_w4a8 3.16 GB 14 to 16 % off

There is no VAE file: Load VAE's built-in pixel_space is the VAE.

Use

  1. Install ComfyUI-PJiT: clone it into ComfyUI/custom_nodes (no pip install) and restart ComfyUI 0.44 or newer.

  2. Download the files:

    cd ComfyUI/models
    hf download PedroMarinhoDev/P-JiT-21K-ComfyUI diffusion_models/pjit_21k_bf16.safetensors --local-dir .
    hf download Comfy-Org/Qwen3.5 text_encoders/qwen3.5_4b_bf16.safetensors --local-dir .
    
  3. Open Templates → ComfyUI-PJiT → pjit_text_to_image and run. Linum's settings are set: 50 steps, euler, simple, cfg 15 and an empty negative prompt. Write captions of 50 to 80 words, or use the prompt upsampler workflow. The templates also include a refiner pass (image to image at low denoise) and Linum's samples, seed for seed.

Measured

RTX 3090, 1024×1024, 50 steps. Against the images Linum's own code makes on the same card, same seeds (portrait, birthday, panda from their samples); their code against itself, rerun in another batch shape, differs by 40.5 to 49.3 dB.

File Seconds per step Against Linum's images
pjit_21k_bf16 0.34 (0.39 with 4 GiB free) 40.2, 39.5, 47.7 dB, pixel for pixel the fp32 file's images
pjit_21k_int8_convrot 0.19 (0.19 with 4 GiB free) 32.8, 31.7, 40.3 dB
Linum's fp32 release 0.35 (0.97 with 4 GiB free) 40.2, 39.5, 47.7 dB

The same three subjects from each model file (bf16 text encoder), then from each text encoder (bf16 model). Stock noise, the same seed per row; the last row is the portrait's eyes at full size. fp32 and bf16 are the same pixels; W4A8 changes faces the most.

The same three images from the fp32, bf16 and int8 ConvRot model files, and a full-size crop of the portrait's eyes from each The same three images from the bf16, int8 ConvRot, W6A8 and W4A8 text encoders, and a full-size crop of the portrait's eyes from each

What changed from the release

Both files are converted from Linum's fp32 model.safetensors of Linum-AI/pjit-21k by the pack's tools/convert_pjit.py. The keys are the release's.

  • bf16: the Linear and conv weights and biases in bf16, and the RMSNorm and LayerNorm gains and the output modulation in fp32. Linum's code runs under bf16 autocast, which rounds those Linears and convs to bf16 before every matmul and applies the norms in fp32, so the model computes the same numbers from this file as from the fp32 one.
  • int8 ConvRot: as the bf16 file, plus q, k, v, o, w13 and w2 of all 22 blocks and the 4 refiner blocks in ComfyUI's int8_tensorwise format with ConvRot: each weight rotated by a Hadamard matrix in groups along its input (256, or 64 for the 2944-wide inputs, since ComfyUI's Hadamard sizes are powers of 4), then rounded to int8 with one fp32 scale per output row, from the fp32 weights. The largest relative weight error is 1.6 %. Each such layer carries its comfy_quant metadata, so ComfyUI's mixed-precision Linear loads it.
  • Text encoders: from Comfy-Org's bf16 Qwen3.5-4B by the pack's tools/quantize_text_encoder.py, on Comfy-Org's recipes for their Qwen3.5-9B files. int8 ConvRot: every Linear, the embedding table (also the output layer), the vision tower and the MTP head. W6A8 and W4A8: the language model's Linears in ComfyUI's w6a8_int8 and asym_w4a8_int8 formats (fp8 scales per 16 weights, ConvRot groups of 256, a 16-level codebook for W4A8), rounded to nearest without calibration, and the rest int8 as above.

License

Apache-2.0, as the original weights: P-JiT 21K by Linum, Qwen3.5-4B by Qwen. See NOTICE.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for PedroMarinhoDev/P-JiT-21K-ComfyUI

Finetuned
(3)
this model