Nodes/ComfyUI-Apt_Preset/flow_stage_tentor_load
ComfyUI Node

flow_stage_tentor_load

Read a finished staged run back as raw latents

By cardenluo·Created 2 years ago·Updated 3 days ago· 355
flow_stage_tentor_load
    • data1
    • data2
    • index_data1
    • index_data2
    ◄run_iddefault►
    ◄start_stage_index1►
    ◄end_stage_index1►
    ◄index1►

    The whole point of Apt_Preset's flow_stage loop is that nothing evaporates between passes: every stage writes its payload to disk, so a five-stage run leaves five stages' worth of tensor on your drive. flow_stage_tentor_load is the reader for that pile. No VAE decode, no re-sampling - it hands you back the actual LATENTs the stages produced, one per stage, ready to decode, upscale or re-sample however you like.

    (The name: "tentor" is the pack's spelling of tensor all over this family - View_bridge_tentor, flow_case_tentor, this one. Not a typo you need to fix, and worth knowing when you're grepping the repo.)

    How it works

    You give it a run id and a 1-based inclusive range. For each stage number in that range it looks for the saved payload file for both channels (data1 and data2), decodes it with the pack's own payload codec - safetensors plus a JSON descriptor tucked into the file metadata under the key stage_payload - and appends the result to a list.

    That descriptor is why no VAE is involved: the stage format records what was saved (latent, image, mask, audio, video or plain JSON) and how the tensors are laid out, so the loader can rebuild the exact dict the stage handed out, including a {"samples": ...} LATENT you can feed straight into a sampler or a VAEDecode.

    It is also why the file sizes look nothing like a PNG.

    Inputs and outputs that matter

    • run_id - the same string you gave flow_stage_begin. Default is "default", which is what single-stage runs use. A multi-stage run gets a timestamp id like 260924183000, and that's what you paste here. Don't try to hand-build the directory path: the folder on disk is <safe name>_<10-char hash> of whatever you typed.
    • start_stage_index / end_stage_index - 1-based and inclusive. Set both to the same number for a single stage. The tooltip is explicit that missing stages are skipped, not an error.
    • index - picks the one stage that gets fed to index_data1 / index_data2. Also 1-based.

    Outputs: data1 and data2 are list outputs (one LATENT per stage found in the range) and index_data1 / index_data2 are single LATENTs - the picked stage not wrapped in a list. List outputs are the useful bit: ComfyUI runs a downstream node once per item, so a single VAEDecode + SaveImage after this saves the entire run in one queue, and an upscaler after it upscales every stage without a second thought.

    Two behaviours worth internalizing. If a stage in the range has no payload, it's simply absent from the list - so a run that died at stage 3 gives you a two-item list, not an error, and "why is my batch short?" is your first clue something didn't finish. And if the index stage is missing, index_data1/index_data2 come out as execution blockers, which mutes the downstream branch instead of failing the run.

    The node's IS_CHANGED returns a digest of the stage filenames, mtimes and sizes in the range, so it re-runs when new stage files appear - point it at a run that's still going and it keeps up.

    What you'd actually use it for

    Three things, in order of how often they come up. You want stage 5 of something, and re-running stages 1–4 to get it is half an hour you're not getting back. You want to look at what the loop produced before committing to a final pass - the node's own description names the companion for that, View_bridge_tentor, which decodes and merges; this node is the reading half. Or you want to fork the run: take one stage's latent off to a different sampler or upscale model while the rest of the graph carries on.

    Install

    Manager → search Apt_Preset, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/cardenluo/ComfyUI-Apt_Preset.git
    cd ComfyUI-Apt_Preset && pip install -r requirements.txt
    

    Windows users can double-click install-ComfyUI-Portable.bat (or the aki variant) instead of the pip line. Restart ComfyUI afterwards, or the node won't appear.

    Gotchas

    Everything this node reads lives under output/.apt_stage_bridge/, next to the images your other nodes are saving. Two consequences: clearing your output folder - or a "delete all outputs" style cleanup script - silently converts your staged run into a missing stages are skipped empty list, and there is nothing to recover. And since the ranges are resolved by stage number rather than by list position, a gap in the middle shifts nothing; data1[0] is the lowest-numbered stage that exists, not stage 1.

    If you get an empty result and the run definitely finished, check run_id first. It's case-sensitive and hashed into the folder name, so Default and default are different runs.

    CategoryApt_Preset/flow

    Inputs (4)

    NameTypeDefaultDescription
    run_idSTRINGdefault—
    start_stage_indexINT11–50001-based, inclusive.
    end_stage_indexINT11–50001-based, inclusive. Use the same start/end stage index for one stage. Missing stages are skipped.
    indexINT11–50001-based. Picks the single stage fed to index_data1 / index_data2 (single LATENT). Missing stage blocks that output.

    Outputs (4)

    NameTypeDescription
    data1LATENT—
    data2LATENT—
    index_data1LATENT—
    index_data2LATENT—