Nodes/comfyui-mdsnodes/BBox Crop Factor
ComfyUI Node

BBox Crop Factor

The one number that decides how much face your detailer actually sees

By MarwanDSAI·Created 2 months ago·Updated about 22 hours ago· 3
BBox Crop Factor
    • bbox_crop_factor
    ◄bbox_crop_factor1.5►

    Every automatic detailer has the same quiet problem: the detector hands it a tight rectangle around a face, and if you re-render that rectangle at face value you get a floating chin with no jaw attached. So the detailer pads the box before it crops. BBox Crop Factor is that padding, exposed as a node you can wire.

    What it's for

    Detection-and-refine pipelines - FaceDetailer, DetailerForEach, anything else that eats a SEGS bundle - work by cropping the detected region, upscaling it to the guide_size, sampling it fresh, and pasting it back. The crop factor multiplies the rectangle outward before that happens. 1.5 means "take the box and give me 1.5× that area," which buys the model neck, hairline and shoulder to work with instead of a disembodied feature.

    In the wider workflow this is the difference between a face that blends and one that has a visible rectangle of different skin tone around it. The mask feather helps, but the crop factor is upstream of all of that: the model can only blend into context it was allowed to see.

    This node does exactly one thing. It hands a float to whatever input you wire it to, so that when you decide 1.7 looks better than 1.5, you change one node instead of hunting six detailers scattered across a canvas the size of a tennis court.

    How it works

    There is no computation here and no cleverness. The node holds a float, rounds it to two decimals, and returns it on a FLOAT output named bbox_crop_factor. That's the whole class - you can read it in about five lines. Which is the point: the value becomes a wire, and a wire can fan out.

    The one input is bbox_crop_factor itself: a float, default 1.5, minimum 1, maximum 10, step 0.1. The author's own tooltip calls it "Multiplier for bounding box crop context/expansion," which is accurate - it's a multiplier, so 2.0 is double area, and the ceiling of 10 is generous enough for compositing tricks like "give the detailer the entire half of the frame."

    The output, bbox_crop_factor (FLOAT), goes into your detailer's crop-factor input. On most detailer nodes that field is a widget by default, so right-click it and choose Convert widget to input, then drag the wire in.

    Installing it

    It ships in ComfyUI-MDSNodes, MarwanDSAI's utility pack. Easiest route is ComfyUI Manager: Manager → Install Custom Nodes, search ComfyUI-MDSNodes (the README's spelling) or just MDSNodes, install, restart. By hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/MarwanDSAI/comfyui-mdsnodes
    # restart ComfyUI
    

    No pip step and nothing to download. The repo's requirements.txt is empty and the README states no extra packages are required, because the whole pack is plain Python string and number manipulation on top of ComfyUI itself. No models, no pip install.

    Then right-click the canvas and search the display name, BBox Crop Factor. Its category is MDSNodes/Constants, alongside the rest of the pack's typed constants.

    Common issues

    You can't find the node. The constants all landed in pack version 1.8.0 (Aug–Sep 2026). If your clone is older, update through Manager and restart - a stale install is the usual reason a node that "should be there" isn't in the search results.

    The node won't go below 1.0. That's deliberate: a factor under 1 would crop inside the detected box and slice the thing you were trying to fix. If you genuinely need a tighter crop, this constant can't give it to you.

    Your detailer ignores the wire. Check the connection landed on the crop-factor input specifically - several detailers have crop factor and a separate guide-size / padding input, and they are not interchangeable. A wire on the wrong one runs without error and does nothing.

    Detail on a small face in a wide shot got worse when you raised it. Larger factor means more context but a lower effective resolution on the face, because the crop is scaled to guide_size either way. If pushing the factor to 2.5 blurs the eyes, raise the guide size too - see Guide Size in the same pack for the same one-value-many-consumers approach.

    CategoryMDSNodes/Constants

    Inputs (1)

    NameTypeDefaultDescription
    bbox_crop_factorFLOAT1.51–10Multiplier for bounding box crop context/expansion.

    Outputs (1)

    NameTypeDescription
    bbox_crop_factorFLOATThe bbox crop factor float value.