Nodes/🐰 MaraScott Nodes/🐰 Apply Kohya's HiresFix - sd1.5 only /v (from laksjdjf)
ComfyUI Node

🐰 Apply Kohya's HiresFix - sd1.5 only /v (from laksjdjf)

Generate at full resolution in one pass β€” Kohya's 'deep shrink' HiresFix, bundled in

By MaraScottΒ·Created 3 years agoΒ·Updated 10 months agoΒ· 179
🐰 Apply Kohya's HiresFix - sd1.5 only /v (from laksjdjf)
  • model
  • MODEL
β—„ds_depth_13β–Ί
β—„ds_depth_23β–Ί
β—„ds_timestep_1900β–Ί
β—„ds_timestep_2650β–Ί
β—„resize_scale_12.0β–Ί
β—„resize_scale_22.0β–Ί

The name tells you most of what matters: this node applies Kohya's HiresFix, and it's SD 1.5 only. It's not a wrapper that downloads anything extra - MaraScott bundled laksjdjf's original implementation straight into the pack, so if you've ever seen the standalone "DeepShrink" node and wondered what it did, this is the same trick under a fancier title.

What it actually is: a model patch, not a sampler or an upscaler. You feed a MODEL in, you get a patched MODEL out, and you wire that into your KSampler. Nothing else in your graph changes.

Why you'd bother

The classic hi-res fix in ComfyUI is two passes: generate small, then run a low-denoise img2img pass at target resolution to add coherent detail. It works, but it doubles your render time and, pushed too hard, it drifts composition.

Kohya's approach - announced on Twitter in November 2023 and widely called "Deep Shrink" - is a single pass. Instead of a second sampling run, it patches the UNet so that during the early, noise-dominated steps the latent is downscaled (bicubic, by your resize_scale), and the model works at reduced resolution where the details don't matter yet. Mid-generation, the latent gets interpolated back up and the later steps add the real detail at full resolution. The result: you can generate directly at a higher resolution than the model's native size without the doubling/artifact artefacts that naΓ―ve high-res generation produces.

The knobs that matter

The node has two shrinking stages, each with three settings - that's the _1 and _2 suffix on everything:

  • ds_depth_1 / ds_depth_2 (default 3): which UNet block depth the shrink happens at. Deeper numbers patch deeper blocks. Leave at 3 to start.
  • ds_timestep_1 / ds_timestep_2 (default 900 / 650): the timestep boundaries. Above ds_timestep_1, the first-stage shrink is active; between the two timesteps, the second stage. High timesteps = very early in denoising.
  • resize_scale_1 / resize_scale_2 (default 2): how much the latent is downscaled. 2 means half size. 1 disables that stage effectively.

Defaults are a perfectly sane starting point: shrink by 2 at depth 3 for timesteps above 900, then again for timesteps down to 650. The only output is the patched MODEL.

Where it goes

Right after your checkpoint and LoRA loaders, immediately before the KSampler - it needs to see the fully-assembled model. Community reports from the original release thread confirmed that's the correct spot, and that the patch noticeably changes generation even at defaults.

CheckpointLoader β†’ LoRA β†’ [this node] β†’ KSampler

Install & gotchas

It ships in the MaraScott pack, so install the pack once:

cd ComfyUI/custom_nodes
git clone https://github.com/MaraScott/ComfyUI_MaraScott_Nodes
# restart ComfyUI

Or use ComfyUI Manager and search "MaraScott". No extra models, no API keys.

Three things to know before you get excited:

  1. SD 1.5 only. The display name says it, and the implementation reaches into the classic UNet's input_blocks - it isn't built for SDXL, SD3 or Flux. On those, use the normal two-pass hi-res fix instead.
  2. It pairs well with LCM - people were running LCM + this at 1280Γ—544 in about a second back when it launched.
  3. It's a vendor copy: MaraScott imported laksjdjf's code (py/vendor/kohya_hiresfix/) so you don't need to install laksjdjf's own repo. But it also means updates trail the upstream - if you hit a weirdness, the fix may live upstream first.
Category🐰 MaraScott/vendor

Inputs (7)

NameTypeDefaultDescription
modelMODELβ€”
ds_depth_1INT3-1–12β€”
ds_depth_2INT3-1–12β€”
ds_timestep_1INT9000–1000β€”
ds_timestep_2INT6500–1000β€”
resize_scale_1FLOAT2.01–16β€”
resize_scale_2FLOAT2.01–16β€”

Outputs (1)

NameTypeDescription
MODELMODELβ€”