DyPE_Model
Pick your 4K-capable transformer without thinking too hard
- model
DyPE_Model is the least glamorous node in the ComfyUI_DyPE pack and the one that decides whether the rest of the graph works at all. It's a model loader, but not the Load Diffusion Model you're used to - it loads the transformer in a form the DyPE machinery can actually patch, and that's the whole job.
DyPE (Dynamic Position Extrapolation, from the HUJI group's paper) is a way to generate way past a model's training resolution - 2048, 4096, up to 4K - without retraining, by fiddling with the position encodings during denoising instead. smthemex's pack (a wrapper around the official guyyariv/DyPE code) rebuilds the whole sampling path inside diffusers with patched transformer classes, so it needs its own loader. This is it.
Pick a single-file checkpoint from ComfyUI's diffusion_models folder, or a GGUF from the gguf folder, and out comes a MODEL. The quiet trick is in how it loads. The pack ships vendored transformer code for Flux 1 (Krea-dev), Flux 2 Klein, Qwen-Image, and Z-Image, with the RoPE position-encoding code replaced by the DyPE version (dype=True, YARN-style scaling). The node sniffs the model family out of the filename - flux, klein, qwen - and hot-swaps diffusers' transformer class for its own patched copy before from_single_file runs. A filename that matches none of those is assumed to be Z-Image, and if it contains turbo, it loads the Z-Image-Turbo variant. The Klein path reads 4b/9b off the name to pick the right config, so naming your files well is not optional decoration.
The inputs that matter
Only two, both dropdowns populated from your model folders:
- diffusion_models - every
.safetensorsinComfyUI/models/diffusion_models. The README's supported list: FLUX.1 Krea-dev (regular or the fp8 build; the "scaled" variants are not supported), FLUX.2 Klein 4B/9B, Qwen-Image, Z-Image, Z-Image-Turbo. - gguf - quants from
ComfyUI/models/gguf, if you'd rather trade a little quality for VRAM headroom (Klein and Z-Image have GGUF packs within days of release, same story as Flux 1).
Set one, leave the other at "none". Setting both is also allowed, but pointless - GGUF wins.
The single output, model, feeds straight into DyPE_Condition. You don't wire this to anything else; the pack's nodes are a closed chain, Model → Condition → KSampler → decode.
Installing
Same path for the whole pack. Easiest is ComfyUI Manager: search "ComfyUI_DyPE" and install. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/smthemex/ComfyUI_DyPE
pip install -r requirements.txt
That requirements list is where it stops being a toy: diffusers, transformers, accelerate, sentencepiece, opencv-python, omegaconf. If you're on the Klein models, the README wants a recent diffusers (0.37+). Restart ComfyUI after.
Where people get burned
- The family detection is filename-based and dumb. A Klein GGUF named
klein4b.ggufgets the right 4B config; one namedmodel.ggufdefaults to 4B anyway, and a Qwen model whose name doesn't contain "qwen" gets treated as Z-Image. Keep the family token in the filename. - This node only loads the transformer. The CLIP, VAE, and any LoRAs are handled downstream, so "no model found" usually means you haven't dropped the right files in
diffusion_modelsyet. - The fp8 Krea build works fine and is the sensible default if you have 12–24GB; true 4K sampling is a memory monster no matter what you load.
It's a boring node. That's the point - one dropdown pair, zero knobs, and it quietly makes the interesting nodes possible.
Inputs (2)
| Name | Type | Default | Description |
|---|---|---|---|
| diffusion_models | COMBO | 1 options: none | |
| gguf | COMBO | 1 options: none |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |