Nodes/comfyui-conduit-optimizer/๐Ÿ‘๏ธ Conduit Sense (Type Detector)
ComfyUI Node

๐Ÿ‘๏ธ Conduit Sense (Type Detector)

The node that reads your prompt and guesses what you're doing

By JosephOIbrahimยทCreated 8 months agoยทUpdated 8 months agoยท 1
๐Ÿ‘๏ธ Conduit Sense (Type Detector)
    • detection_result
    • detected_type
    โ—„analyze_prompttrueโ–บ
    โ—„analyze_dimensionstrueโ–บ
    โ—„promptโ–บ
    โ—„width1024โ–บ
    โ—„height1024โ–บ
    โ—„has_controlnetfalseโ–บ
    โ—„has_video_nodesfalseโ–บ

    Conduit Sense is the pack's "what kind of workflow is this?" node. Give it your prompt and image dimensions and it looks at a handful of signals, scores a list of workflow types, and tells you which one it thinks you're running - portrait, landscape, anime, photorealistic, video, upscale, controlnet, and so on. The point is automation: if the pack knows you're doing anime at speed rather than photorealistic at quality, the rest of the Conduit nodes can pick sane defaults for you.

    How it works

    The mechanism is refreshingly transparent - it's keyword and geometry matching. detect_workflow scores each type by counting hits:

    • Prompt keywords: "portrait/face/headshot/person" bump portrait; "anime/manga/cartoon" bump anime; "photo/realistic/photography/dslr" bump photorealistic; "landscape/mountains/ocean" bump landscape.
    • Dimensions: an aspect ratio over 1.5 leans landscape, under 0.7 leans portrait, and anything over 2048px on a side suggests upscale.
    • Two manual flags: has_controlnet and has_video_nodes - flip these to tell it what's in your graph, since it can't inspect your workflow graph itself.

    The type with the highest score wins, and if nothing clears a confidence threshold you get unknown. Along with the detected_type string, it returns a detection_result object containing the confidence, the full score breakdown across every type, and a recommended_settings dict - precision mode, tiling, face-enhance, and similar suggestions per detected type.

    There's a two-layer thing going on: analyze_prompt (on by default) decides whether to scan the prompt text, and analyze_dimensions (on by default) decides whether to use width/height. Turn off one and it just won't count those signals. If you leave both off and provide no flags, everything scores zero and you get unknown - the node is honest about not knowing.

    Inputs and outputs

    Required: analyze_prompt and analyze_dimensions (both booleans, both on). Optional: prompt (multiline), width (default 1024), height (default 1024), has_controlnet (default false), has_video_nodes (default false). Outputs: detection_result (type CONDUIT_SENSE) and detected_type (a STRING you can read, log, or branch on).

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/joe002/comfyui-conduit-optimizer
    

    Or ComfyUI Manager โ†’ search "comfyui-conduit-optimizer" โ†’ restart. No downloads; PyTorch 2.0+ only.

    Common issues

    Keep expectations proportional. Sense is a keyword matcher, not a vision model - a prompt like "a man in an anime style, photo background" can genuinely confuse it, and it has no idea what nodes you've actually wired up unless you tell it via the flags. And right now its detection feeds ConduitApply, which logs the result but doesn't act on it, so the recommended_settings are informational. Where it's genuinely handy today: as a small text classifier in a workflow you control - e.g., routing different prompt styles to different samplers based on detected_type.

    CategoryConduit/Detection

    Inputs (7)

    NameTypeDefaultDescription
    analyze_promptBOOLEANtrueโ€”
    analyze_dimensionsBOOLEANtrueโ€”
    promptoptSTRINGโ€”
    widthoptINT1024โ€”
    heightoptINT1024โ€”
    has_controlnetoptBOOLEANfalseโ€”
    has_video_nodesoptBOOLEANfalseโ€”

    Outputs (2)

    NameTypeDescription
    detection_resultCONDUIT_SENSEโ€”
    detected_typeSTRINGโ€”