Skip to content

How to Run P-JiT 21K: $21K Open Image Model

Show HN just dropped P-JiT 21K - a decent text-to-image model trained for ~$20K with Apache 2.0 weights. Here's how to run it and what actually breaks.

6 min readBeginner

Key takeaway: Linum’s P-JiT 21K is a real Show HN text-to-image drop trained for about $21K, with Apache 2.0 weights you can run today. Portraits, products, and stylized single-subject scenes work if you feed dense 50-80 word captions. It will not replace FLUX-class stacks for text-in-image or crowded full-body shots. One rule before you judge quality: long captions, or the built-in upsampler.

Two brothers at Linum open-sourced a ~2B pixel-space model trained from scratch on H100 time that costs roughly a used car. X and LocalLLaMA got loud because the weights and code are full Apache 2.0 – not another gated research tease. This is the weekend-operator guide: which path to pick, how to prompt so outputs stop looking muddy, and the traps clone-and-pray posts skip.

What just dropped (and why it matters for you)

As of the Linum field notes publish, the run cost $21,038 total: $20,348 pretraining (8,139 H100-hours) and $690 post-training (276 H100-hours) at $2.50 per H100-hour, on 64 H100s. Roughly 610M samples at 512² then ~50M at 1024². Sampling weights sit around 2.18B parameters (~2.42B with training-only heads). Architecture is Pyramid-JiT – pixel-space diffusion, no VAE, 32×32 patches, frozen Qwen3.5-4B text encoder reading layers 7, 15, and 27. They call it a research checkpoint toward cheaper video/animation tools, not a polished consumer app.

That invoice is the hook. A lot of “open” image weights are fine-tunes of someone else’s foundation, or they arrive with commercial license friction. Here the recipe and checkpoints are yours under Apache 2.0 – which is why people are actually cloning it instead of just screenshotting the blog.

Method A vs Method B: pick your on-ramp

Three practical doors. I ranked them the way I’d choose for a single weekend box.

Path Effort Control Best when
A. Official generate.py Clone + venv + CUDA GPU Highest (seeds, APG, native ratios) You want release-faithful images
B. ComfyUI community nodes Custom node + full Qwen folder High once wired You already live in Comfy graphs
HF Space Browser only Low You just want a quick look

Method A wins for most people reading this. Sampler defaults live in the repo: 50 Euler steps, adaptive projected guidance at scale 15 (the APG paper), empty negative, noise scale 4 at 1024px. Comfy nodes from RealRebelAI are brand-new and labeled experimental – they report RTX 3070 8 GB tests with optional layerwise offload. The HF Space is fine for curiosity. Reproducible work? Not really.

Pro tip: Muddy or generic first outputs almost always mean a three-word prompt. Fix caption length before you touch sampler knobs.

Detailed walkthrough: official generate.py (the winner)

CUDA NVIDIA GPU required. As of the GitHub README, DiT weights are ~8.7 GB fp32; the Qwen3.5-4B encoder is ~8 GB bf16; activations sit on top. “Weights fit” is not the same as “generates without OOM.”

  1. Install system bits Triton may need, then clone and install editable:
sudo apt-get install -y build-essential python3-dev python3-venv
git clone https://github.com/Linum-AI/pjit-21k && cd pjit-21k
python3 -m venv .venv && source .venv/bin/activate
pip install -e .
  1. First run pulls weights and the text encoder from the Hub (model card path: Linum-AI/pjit-21k).
  2. Decide how you’ll prompt. Two honest options:

Option 1 – upsampler (easiest for short ideas). Export an OpenRouter key so Claude can expand your line into a 50-80 word caption the model expects:

export OPENROUTER_API_KEY=...
python generate.py --prompt "oil painting of weathered fisherman smoking a pipe" 
 --aspect_ratio square --seeds 0 --out_dir outputs

Option 2 – no API. Write the long caption yourself and skip the LLM:

PROMPT="Macro product shot of a brushed-steel espresso tamper on matte charcoal stone, three-quarter angle, soft window light from camera left, shallow depth of field, fine concentric machining rings visible on the base, cool neutral grade, no logo text, quiet workshop mood."
python generate.py --no_upsample --aspect_ratio 3:2 --seeds 2 --prompt "$PROMPT" --out_dir outputs

Native --aspect_ratio values the model actually trained on (sides ~1 megapixel):

  • square → 1024×1024
  • tall → 864×1216
  • 4:3 → 1152×864
  • 3:2 → 1248×832
  • 16:9 → 1280×720

Custom --width/--height work (padded to multiples of 32), but those five ratios look best. Default sampler matches the release settings. Official noise is drawn H100-SXM style so the same seed lines up across NVIDIA GPUs; add --native_noise only if you want your local GPU’s RNG instead.

What does “good” look like here? Close portraits, single animals, product-ish stills, soft stylized illustration. Blog gallery samples skew that way. Don’t open with a six-person action scene.

Edge cases that burn an afternoon

Generic “clone the repo” posts skip these.

Caption length is the real CFG. Training used dense 50-80 word captions. Short prompts “give noticeably worse images” – their wording, not a forum myth. Refuse OpenRouter? Upsample mentally: subject, framing, lighting, materials, background, mood. When the upsampler runs, generate.py writes the expanded text beside the PNGs. Save it.

Text is not broken; it was removed. Linum filtered rendered text, PDFs, slides, and posters because that data doesn’t help their animation roadmap. Logo mockups and book pages fail in boring ways. Use a text-specialist model for that job.

Bodies, crowds, and “world knowledge.” Full-body limbs, six cars, multi-person interaction, guitar string counts, die faces – listed weak spots for a small DiT. Occasional wins happen. Don’t build a product pipeline on them without a larger follow-up model.

Memory and Comfy reality. Official path is whole-model CUDA. Community Comfy notes: quantized GGUF/INT8 paths aren’t supported yet; OOM fixes are lower res, free VRAM, CPU encode, or experimental layerwise offload (8 GB cards are in the test notes). Treat Comfy as beta until a fixed seed matches generate.py.

Seed pedantry. Gallery images were often batched. Solo vs batch can shift pixels by under 1/255 from GPU matmul rounding. Chasing bit-exact? Match batch size and keep the H100-style noise path.

Is $21K the new floor for a “decent” from-scratch T2I, or a one-off because pixel-space + pyramid readouts + brutal data filtering lined up? The field notes make a strong efficiency case. We still don’t have five independent labs reproducing the exact recipe on public clusters.

FAQ

Can I use P-JiT 21K commercially?

Yes – Apache 2.0 on weights and code per the GitHub LICENSE. Read that file before you ship anything.

Do I need an API key to generate anything?

No. Pass --no_upsample and a long caption you wrote. OpenRouter is only for the optional Claude rewrite that turns “cat on a roof” into the dense paragraph the network expects. First-timers often blame the model after five-word prompts; the failure mode is the caption, not the DiT.

How does this compare to running FLUX-class or other Apache image models?

Not the same job. P-JiT is a small from-scratch pixel-space research checkpoint aimed at training efficiency and future video cost, with known holes in text and multi-subject scenes. FLUX-class Apache options are more productized stacks – different VRAM profiles, different ecosystems, better when you need legible poster type tomorrow. If you want to study or fine-tune an efficient open recipe and pull strong single-subject aesthetics locally, these weights are one of the more interesting downloads you can grab this week.

Next action: clone Linum-AI/pjit-21k, run the product-still command with --no_upsample, then regenerate the same idea as a lazy short prompt with the upsampler on – side by side. That single A/B teaches you more about this model than another benchmark chart.