Nodes/ComfyUI-DAELab-Custom-Nodes-Library/Badge 8.7 Stage Execution (DAELab)
ComfyUI Node

Badge 8.7 Stage Execution (DAELab)

The badge workflow's paid-call engine room

By TeutonicMepheles·Created 4 months ago·Updated 3 days ago· 0
Badge 8.7 Stage Execution (DAELab)
    • image
    • report
    ◄request_json{}►

    What this is for

    This node has one input and it's a text box. That should tell you something about who it's for: Badge 8.7 Stage Execution is not a node you drop on the canvas and wire up, it's the backend half of a specific App-Mode workflow. The 8.7 front end compiles everything you clicked - the stage you're on, which image is the target, your selection, your material list, your height config, the output size - into a JSON string and hands it to this node. The node then builds and runs the actual generation graph, composites the result deterministically, and returns an image plus a report.

    If you're here because you're trying to make badge product renders with a paid instruction-editing model and you want masked edits that don't touch anything outside the selection, this is the engine. If you're here hoping for a general-purpose image editor node, keep walking - hand-written request_json will fight you.

    It is an output node, which is worth knowing: it's a terminal. It writes to the normal ComfyUI output area, and it's what gets queued when you hit generate in the App panel.

    How it works

    The node reads the stage out of the request and dispatches.

    For a full generation stage it expands a graph containing a native OpenAIGPTImageNodeV2 - the official ComfyUI API node, billed against your ComfyUI account credits, which is why this is a pay-per-click workflow and not a free one. For a local edit stage it runs the masked edit, then splices the candidate back into the master through the pack's deterministic composite so that pixels outside the validated mask are byte-identical to what you had before. For material regions it goes further: region masks are frozen before generation, one masked call per region per output, colour finishing where the reference demands it, then a composite limited to the union of the regions.

    Under the hood the request also carries a preview/apply contract. A preview_token from a server-side mask validation has to accompany an apply, which is how the front end guarantees it never sends a stale selection to a paid call. Change the image, the mask, the prompt or the size and the next click revalidates automatically, so you never sit there with an error saying "preview first".

    The report it returns is not decoration. It contains effective_prompt - the literal text sent to the model - plus material_processing, region pixel counts and model-call counts. When a result comes back weird, that string is your first stop, because your App-Mode settings and the prompt the model received are two different things.

    The inputs and outputs

    request_json - required, multiline string, defaults to {}. Practically always wired from the front end, never typed. An empty object isn't a valid stage; it'll fail or no-op.

    Outputs: image (the batch result) and report (JSON string, also surfaced in the UI for the workflow's history panel).

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/TeutonicMepheles/ComfyUI-DAELab-Custom-Nodes-Library.git
    # restart ComfyUI
    

    Then load #8.7 - Badge Workflow from the pack's workflows, switch to App Mode, and work from the two tabs. There's no useful manual wiring path - the front end supplies the compiled request and the model selection.

    Requirements worth knowing before you start: you need a recent ComfyUI core (the pack's V3 nodes want comfy_api.latest), a logged-in ComfyUI account with credits, and cv2/scipy available for the region geometry. No local checkpoints are involved for the generation itself.

    Where people get burned

    The money. Every generation is a paid API call; region materials multiply it - the pack's own notes describe a two-region, two-variant job as six calls. Test at Low quality and one image before you discover this with an eight-region badge.

    Stale front end. The request is compiled by JavaScript from web/. Update the pack without restarting ComfyUI, or leave a stale front-end cache, and you get shape mismatches between what the browser thinks the request is and what the Python expects. Restart, hard-refresh.

    No module named 'comfy_api' means your ComfyUI core is old. Update ComfyUI - do not pip install comfy_api, there's a squatted-looking package with that name and it isn't the fix.

    Old saved workflows. The pack explicitly keeps this node ID stable for compatibility and warns against enabling an older split-out copy of the pack at the same time, which produces duplicate node IDs and unpredictable registrations. One pack directory, one install.

    CategoryDAELab/Badge/App

    Inputs (1)

    NameTypeDefaultDescription
    request_jsonSTRING{}—

    Outputs (2)

    NameTypeDescription
    imageIMAGE—
    reportSTRING—