Nodes/Shima/Shima ControlNet Agent
ComfyUI Node

Shima ControlNet Agent

Preprocess, size-match, and hand off

By KDB-USJP·Created 6 months ago·Updated 6 months ago· 2
Shima ControlNet Agent
  • image
  • shima.commonparams
  • modelcitizen.bndl
  • shima.controlbus
  • panelinputs.bndl
  • shima.controlbus
  • processed_image
control_typecanny
strength1.00
fit_methodcrop to fit
bypass_preprocessingfalse
use_commonparamstrue
allow_external_linkingfalse

ControlNet workflows have two eternal annoyances: your reference image never matches the latent resolution, and every control type needs its own preprocessor with its own model. Shima ControlNet Agent bundles all of that into one node - it auto-sizes your image to the target resolution, runs the preprocessor for the control type you picked, and packs the result into a control bus that the rest of the Shima pipeline consumes. It's the pack's opinionated take on "just make my ControlNet work."

How it works

The flow is three steps, and each one is worth understanding.

1. Resolve target size. It reads width/height from a shima.commonparams bundle (from Shima.Commons, or a Model Citizen bundle as fallback) - or defaults to 1024×1024. This is the "why does my control map always fit" magic: the node knows what the sampler wants before it preprocesses.

2. Fit the image. fit_method decides how your source becomes that target size:

  • crop to fit - center-crops to the right aspect ratio, then resizes. Loses edges, keeps everything.
  • pad to fit - letterboxes with black bars, keeps the whole image.
  • stretch - distorts to fill.
  • skip - leave it at original size, for when your map is already correct (that's what bypass_preprocessing is for too).

3. Preprocess. control_type picks the extractor: canny (OpenCV edge detection with auto-thresholds), scribble (adaptive threshold sketch), depth (a Depth Anything v2 model that auto-downloads from Hugging Face on first use), lineart (an auto-downloading lineart model), color (a fast pixelation into mood-board blocks), and pose - which, honestly, is a stub: it passes the raw image through and prints a warning that native pose detection needs an external node. Don't expect pose skeletons out of this box.

The output is two things: the processed_image (your control map) and a shima.controlbus - a LIST that accumulates an instruction per agent. Chain multiple ControlAgents by feeding the previous one's bus into the next's shima.controlbus input, and you've built a stack of control signals.

The inputs that matter

  • image - your reference.
  • control_type - canny / depth / pose / lineart / scribble / color.
  • strength - 0–10 (note the scale: the ControlNet weight per the KB is usually 0.3–1.2, so don't be afraid of small values).
  • fit_method - crop to fit is the sensible default.
  • bypass_preprocessing - on if your image is already a proper control map.
  • shima.commonparams - the resolution source; connect your Commons bundle.

Installing it

Part of the Shima pack. ComfyUI Manager → search Shima, or:

cd ComfyUI/custom_nodes
git clone https://github.com/KDB-USJP/shima_wf.git Shima

Restart ComfyUI. Depth and lineart pull models from Hugging Face on first use, so have internet for the first run; canny/scribble need OpenCV (opencv-python), which most ComfyUI installs already have.

Common issues

  • "Canny passes my raw image through." OpenCV isn't installed, so the node logged a warning and fell back to passthrough. pip install opencv-python fixes it.
  • "Pose does nothing." Known limitation - pose detection requires an external node. Plan accordingly.
  • "First depth run is slow." It's downloading the Depth Anything model. Subsequent runs are cached.
  • "Where's my actual ControlNet apply?" This node preprocesses and packages; the application to conditioning happens in the Shima sampler/master-prompt side that consumes the control bus. If you're using vanilla ComfyUI nodes, you'd use the processed_image output with a standard ControlNet loader instead.

It's a genuinely useful glue node if you live inside Shima's ecosystem, and a decent preprocessor pack if you only use half of it. Just read the pose caveat before you promise yourself a pose-controlled workflow.

CategoryShima/ControlNet

Inputs (11)

NameTypeDefaultDescription
imageIMAGE
control_typeCOMBOcanny6 options: canny, depth, pose, lineart, scribble, color
strengthFLOAT1.000–10
fit_methodCOMBOcrop to fit4 options: crop to fit, pad to fit, stretch, skip
bypass_preprocessingBOOLEANfalseCheck this box if your image is already properly formatted for your chosen controlnet.
shima.commonparamsoptDICTProvides the target latent resolution for auto-sizing.
modelcitizen.bndloptBNDLFallback bundle to parse commonparams if direct commonparams are unavailable.
shima.controlbusoptLISTDaisy-chain previous ControlAgents here.
use_commonparamsoptBOOLEANtrueIf True, use target resolutions from Shima.Commons or ModelCitizen.
allow_external_linkingoptBOOLEANfalseAllow connections outside the Island
panelinputs.bndloptBNDLOverrides panel settings using an external PanelBNDLer node

Outputs (2)

NameTypeDescription
shima.controlbusLIST
processed_imageIMAGE