Nodes/comfyui_jankdiffusehigh/DiffuseHighSampler
ComfyUI Node

DiffuseHighSampler

Generate Directly at 4K Without the Tiled Workflow Melting Down

By blepping·Created 2 years ago·Updated about a year ago· 37
DiffuseHighSampler
  • highres_sigmas
  • sampler
  • reference_image_opt
  • guidance_sampler_opt
  • reference_sampler_opt
  • vae_opt
  • upscale_model_opt
  • input_params_opt
  • SAMPLER
guidance_steps5
guidance_modeimage
guidance_factor1.00
fadeout_factor0.00
scale_factor2.00
renoise_factor1.00
iterations1
vae_modenormal
yaml_parameters

The standard way to get a big image is the highres-fix loop: generate at native resolution, upscale, then run a few low-denoise steps. It works, but it's two stages bolted together, and past 2x the second pass starts inventing second heads. DiffuseHighSampler is the alternative that does the whole climb inside a single sampler node, and it's mostly model-agnostic - no checkpoint patching, no per-model fiddling.

DiffuseHigh is a 2024 research method from the group behind the yhyun225/DiffuseHigh repo. Blepping's "jank" port implements it as a custom sampler rather than a model patch, which is the clever bit. Deep Shrink and HiDiffusion literally patch the model - that mostly restricts them to SD1.5/SDXL and means enabling the effect changes your seed. A sampler sits upstream of the model, so jank DiffuseHigh runs on Flux and other rectified-flow models too, and you can dial the effect on and off without breaking reproducibility.

How it actually works

Each iteration is upscale → add noise back → run some steps at low denoise (~0.3–0.5). The twist is structure guidance. For the first guidance_steps of every iteration, the sampler mixes in guidance derived from a reference image (the previous pass, or an image you feed in). The reference gets split with wavelets - that's what the pywavelets and pytorch-wavelets dependencies are for - its low-frequency parts carry the composition so the model can't wander into duplicated anatomy, while the sharpened high-frequency detail comes from the denoised output. The model stays on script because it's being told "this is the structure, stay inside it," which is also why you can run these steps at a higher denoise than a plain highres fix would survive.

The inputs that actually matter

Start here and touch almost nothing else:

  • iterations + scale_factor - the resolution ladder. 512×512, scale 2, three iterations gets you to 4096×4096. The tooltip's warning is not rhetorical: this adds up fast.
  • guidance_mode - image matches the original method but needs a VAE encode/decode per guidance step. latent is about twice as fast; the author recommends it, and you can drop guidance_factor a bit to compensate.
  • guidance_steps, guidance_factor, fadeout_factor - how long and how hard guidance applies. Fadeout eases the factor down per step (1.00, 0.75, 0.50, 0.25 for four steps), which reads smoother.
  • renoise_factor - 1.0 is the normal amount of noise. Bump to ~1.02 for slightly more detail.
  • vae_mode - normal, tiled, taesd (fast/cheap but needs the TAESD encoders in models/vae_approx), or tiled_diffusion if you have ComfyUI-TiledDiffusion.

The optional inputs are where the power hides: highres_sigmas (keep it around 0.3–0.5 denoise - plugging raw Karras sigmas in is a classic way to get garbage), sampler, reference_image_opt (feed your own seed image and skip the low-res pre-pass), upscale_model_opt, vae_opt, and input_params_opt for hooking up a DiffuseHighParam node. The yaml_parameters field is a whole advanced control panel - iteration overrides, per-step VAE/sampler switching, sigma tweaks. The README calls the docs sparse; skim the YAML section anyway.

The single output is a SAMPLER - wire it into a SamplerCustom node and set your normal sigmas there.

Installing it

ComfyUI Manager, search JankDiffuseHigh and install. Or the manual route:

cd ComfyUI/custom_nodes
git clone https://github.com/blepping/comfyui_jankdiffusehigh
cd comfyui_jankdiffusehigh
pip install -r requirements.txt

Then restart ComfyUI. Its only dependencies are pywavelets and pytorch-wavelets - Manager installs them automatically, which is refreshingly light for a node this fancy. No model files to download; TAESD mode is the sole extra if you go there.

Where people get burned

The biggest complaints are speed and VRAM. This is slow - multiple full-res iterations at high resolution - and hungry. If you see the model repeatedly unloading/reloading, switch guidance_mode to latent, and if you OOM at high res while a normal img2img fits, set ensure_model_mode: lowvram or novram in the YAML. Brownian-noise (SDE) samplers can misbehave; the author has a workaround but it's not bulletproof. SD3.5 apparently can't handle high resolutions at all, even for img2img - skip it there. And the reference image matters: this method locks onto its structure, so a mediocre first pass stays mediocre. One more gotcha: it works around a long-standing ComfyUI nondeterminism bug, which can change your seed. And if you're on SD1.5, grab the author's MSW-MSA attention from jankhidiffusion - a genuinely free speed lunch at these resolutions.

Categorysampling/custom_sampling/JankDiffuseHigh

Inputs (17)

NameTypeDefaultDescription
guidance_stepsINT5Number of guidance steps after an upscale.
guidance_modeCOMBOimageThe original implementation uses image guidance. This requires a VAE encode/decode per guidance step. Alternatively, you can try using guidance via the latent instead which is much faster.
guidance_factorFLOAT1.000–1Mix factor used on guidance steps. 1.0 means use 100% DiffuseHigh guidance for those steps (like the original implementation).
fadeout_factorFLOAT0.00Can be enabled to fade out guidance_factor. For example, if guidance_factor is 1 and guidance_steps is 4 then fadeout_factor would use these guidance_factors for the guidance steps: 1.00, 0.75, 0.50, 0.25
scale_factorFLOAT2.000.01–1000Upscale factor per iteration.
renoise_factorFLOAT1.00-1000–1000Strength of noise added at the start of each iteration. The default of 1.0 (100%) is the normal amount, but you can increase this slightly to add more detail.
iterationsINT1Number of upscale iterations to run. Be careful, this can add up fast - if you start at 512x512 with a 2.0 scale factor then 3 iterations will get you to 4096x4096.
vae_modeCOMBOnormalMode used for encoding/decoding images. TAESD is fast/low VRAM but may reduce quality (you will also need the TAESD encoders installed). Normal will just use the normal VAE node, tiled with use the tiled VAE node. Alternatively, if you have ComfyUI-TiledDiffusion installed you can use tiled_diffusion here.
highres_sigmasoptSIGMASSigmas used for steps after upscaling. Generally should be around 0.3-0.5 denoise. NOTE: I do not recommend plugging in raw 1.0 denoise sigmas here.
sampleroptSAMPLERDefault sampler used for steps. If not specified the sampler will default to non-ancestral Euler.
reference_image_optoptIMAGEOptional: Image used for the initial pass. If not connected, a low-res initial reference will be generated using the schedule from the normal sigmas.
guidance_sampler_optoptSAMPLEROptional: Sampler used for guidance steps. If not specified, will fallback to the base sampler. Note: The sampler is called on individual steps, samplers that keep history will not work well here.
reference_sampler_optoptSAMPLEROptional: Sampler used to generate the initial low-resolution reference. Only used if reference_image_opt is not connected.
vae_optoptVAEOptional when vae_mode is set to `taesd`, otherwise this is the VAE that will be used for encoding/decoding images.
upscale_model_optoptUPSCALE_MODELOptional: Model used for upscaling. When not attached, simple image scaling will be used. Regardless, the image will be scaled to match the size expected based on scale_factor. For example, if you use scale_factor 2 and a 4x upscale model, the image will get scaled down after the upscale model runs.
input_params_optoptDIFFUSEHIGH_PARAMSOptional: You can use a DiffuseHighParam node to specify additional parameters such as VAEs or upscale models.
yaml_parametersoptSTRINGAllows specifying custom parameters via YAML. You can also override any of the normal parameters by key. Note: When specifying paramaters this way, there is very little error checking.

Outputs (1)

NameTypeDescription
SAMPLERSAMPLERSAMPLER that can be connected to a SamplerCustom or other sampler node that supports a SAMPLER input.