Guide Size
One resolution number for every crop-and-refine pass
- guide_size
Detectors hand back regions of wildly different sizes. Guide Size is the number that normalises them: the resolution each cropped region gets scaled to before it's sampled.
What it's for
Automatic detailing is a loop, and the second step of the loop is the one that decides quality: cut the detected region out, scale it up to something the model can resolve detail at, sample it, paste it back. If the crop goes in at 140px, nothing downstream can fix the fact that the model had 140px of face to work with. If it goes in at the guide size, the model gets a normal generation-sized patch.
So guide size is the resolution budget per detected region, and it's why a 70-pixel face in a wide shot comes out as a smear: there's no budget spent on it. Raising the guide size is the biggest single lever you have on detail in a crop-and-refine pass, bigger than the prompt, bigger than the checkpoint choice.
The reference points, which are worth internalising: 512 for face crops, because that's what face restoration models and most detailers are tuned around; 768–1024 when the crop contains a lot of the frame and you care about texture (hair, fabric, eyes at full-frame detail); and back down to 512 or lower for hands and small features, where a big guide size just spends VRAM to hallucinate knuckles.
Because it's shared across passes, this node matters most in a graph with two or three detailers - face, hands, and a full-figure pass - where you want one number you can move when you realise everything is under-resolved, rather than three that drift apart.
How it works
One input, guide_size: INT, default 512, min 64, max 8192, step 8. One output, guide_size, also INT.
The step of 8 matters: crops get scaled to this size and then encoded to latent, so a multiple of 8 keeps you off the rounding path where a 517-pixel guide turns into a 512-pixel latent and you spend an evening wondering where the softness came from. The tooltip's phrase - "target guide resolution/size" - is accurate and unhelpfully short; the practical meaning is "the side length the detector's crop is resized to."
Wire it into a detailer's guide-size input after right-clicking that widget → Convert widget to input. It's an INT socket, and this node's output is INT, so no conversion dance is needed.
Installing it
Part of ComfyUI-MDSNodes by MarwanDSAI. ComfyUI Manager: search ComfyUI-MDSNodes (or MDSNodes), install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/MarwanDSAI/comfyui-mdsnodes
# restart ComfyUI
No dependencies and no downloads - the repo's requirements.txt is empty, and the README says the pack needs nothing beyond stock ComfyUI. Detectors are a different pack's problem; this node only supplies a number.
Search Guide Size, category MDSNodes/Constants.
Common issues
Missing from the node list. Shipped in pack version 1.8.0. Update in Manager and restart the server - registration happens at startup only.
You raised it to 1024 and got CUDA OOM. Guide size multiplies across detections: twelve faces in a crowd at 1024 is twelve 1024×1024 sampling passes. It's one of the fastest ways to exhaust VRAM in the whole pipeline, and the cost is not linear in image size. Bring it back to 512, or filter the SEGS down to the regions you care about before the detailer sees them.
Detail didn't improve even though you doubled it. Past roughly 1024 on a small face crop you're upscaling a thin source and asking the model to invent - which it will, cheerfully, into a different person. The fix at that point is a bigger source, not a bigger guide size.
The pasted-back region is a different scale than the original. That's the classic only-masked tradeoff: cropping to guide size magnifies perceived detail but can shift scale cues against the surrounding frame. It's why the feather and crop-factor numbers in this pack exist alongside this one - they all feed the same paste-back decision.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| guide_size | INT | 51264–8192 | Target guide resolution/size. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| guide_size | INT | The guide size integer value. |