ComfyUI Node

SG Load

Fetch the newest depth pass on the shot, no version id required

By ksallee·Created about a month ago·Updated 16 days ago· 11
SG Load
    • image
    • video
    • mask
    • version_id
    • code
    • colour_space
    ◄project►
    ◄link▾►
    ◄task▾►
    ◄statuses►
    ◄name_contains►
    ◄sourceauto►
    ◄frame0►
    ◄frame_count0►
    ◄newest_byversion number in the name►
    ◄filters►
    ◄pin_version_id0►

    If your show tracks work in Flow Production Tracking - the thing everyone still calls ShotGrid - the irritating part of using ComfyUI at work isn't the model. It's the handoff. Someone publishes a depth pass, a matte, a plate, and you go find it, download it, drop it in a folder, and hope you grabbed the right revision. SG Load deletes that step: it queries your site for the Version you describe, decodes its media, and hands you the frames as a normal IMAGE.

    Set expectations: this is half of a two-node pack, it's in alpha, and it's aimed at studio pipelines rather than r/comfyui. The entire Reddit corpus holds five threads that mention "ShotGrid". No crowd wisdom to lean on - but unusually thorough docs.

    The thing it's actually good at

    The rule-based picking is the point. You don't wire up a version number, you wire up a question: the newest Version on this Shot, in these statuses, whose name contains "depth". Step 5 of a pipeline publishes, step 6 consumes it, and no id gets copied between graphs - which is exactly the failure mode that hand-typed ids create.

    Where this sits next to the ecosystem's usual habit: ComfyUI's convention is that metadata rides inside the file, since a PNG carries the graph that made it (image-io-metadata.md). A studio is the opposite shape - the record on the site, the pixels on shared storage.

    How it decides what to load

    The node resolves against the site at execution time using the sg-groundtruth client. Each output takes the best source it can find on its own: image prefers a sequence on storage, then a decoded clip, then a still, then a thumbnail; video prefers a movie PublishedFile, then the movie on storage, then the untouched uploaded mp4. source in the advanced fold is the override for when two candidates both look plausible - pick one file and both outputs read from it.

    Decoding goes through ComfyUI's own decoder, the same call core Load Image makes, not Pillow - which is why a 16-bit PNG keeps its levels and a 32-bit float EXR keeps values above 1. Feeding a comp rather than a sampler, that's the difference between usable and not (post-processing.md).

    The inputs you'll touch

    project and link are the two required combos - and link being empty means "search the whole project", so blank is a real strategy.

    Then, of the rest:

    • statuses - comma-separated codes, empty accepts any. There's no "approved" concept in Flow Production Tracking - approved is one code among many, and the tooltip appends the codes your project uses.
    • name_contains - words that must all appear in the Version name. This is how you say "depth v0" without a filter.
    • frame / frame_count (advanced) - frame is the number in the filename, so 1003 means plate.1003.exr, and 0 means "wherever this sequence starts", which is why a 1001–1048 plate needs nothing typed. frame_count 0 reads to the end, 1 gives you a single image, and a batch too big for memory is refused with the number that fits.

    The other advanced ones - newest_by, filters, pin_version_id - are for when the show's naming isn't tidy. pin_version_id beats everything above it.

    What comes out

    image is the batch. video is a real VIDEO, wiring into anything downstream that eats clips, and only fetched when that slot is wired. mask is the decoder's alpha as 1 - alpha, matching core Load Image's convention, with a zero mask when the source has none. Then the record: version_id, code, and colour_space, which is recorded, never applied - nothing converts, nothing guesses sRGB for you.

    The load is recorded as an ancestor too, so a downstream SG Publish names what it came from without anyone typing an id.

    Install

    Through Manager: Custom Nodes Manager, search Flow Production Tracking, Install, restart ComfyUI. Or by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ksallee/sg-comfyui.git
    cd sg-comfyui
    <comfy-python> -m pip install -r requirements.txt
    

    <comfy-python> matters: it must be the interpreter ComfyUI runs on, not whatever python resolves to. Needs ComfyUI 0.34.0+, Python 3.11, and a site you can log into. Dependencies are just sg-groundtruth from PyPI; torch, numpy and av are deliberately not pinned. Then Settings → SG: site address, Log in, Test, pick a project.

    When it goes wrong

    • Settings → SG 404s. ComfyUI was already running when the pack landed, so no routes registered. Restart; if it persists, check the startup log - a pack whose import failed registers nothing.
    • Pickers are empty. Press Test. An empty project list with a passing Test means the account can see no projects; an empty link list means the project has no entity of that type. A new Shot or Version not showing up is usually the 600-second lookup cache - press Sync from SG.
    • Nothing works and the pack looks fine. Run tools/doctor.py with ComfyUI's interpreter; it names both when they differ.
    • A Version holding only a zip comes back as a zip. It isn't unpacked.
    CategoryFlow Production Tracking

    Inputs (11)

    NameTypeDefaultDescription
    projectCOMBOProject to read from.
    linkCOMBOThe Shot, Asset or other entity to read from. Leave it empty to search the project.
    taskoptCOMBONarrow the search to one Task on that entity.
    statusesoptSTRINGThe statuses to accept, separated by commas; empty accepts any. This project allows:
    name_containsoptSTRINGWords that must all appear in the Version name, for example depth v0.
    sourceoptCOMBOautoRead both outputs from this one file. Auto takes the best for each: the frames on the storage for image, the movie for video.
    frameoptINT00–1048576The frame to start at, by the number in the filename: 1003 means plate.1003.exr. 0 starts wherever the sequence starts, so a plate running 1001-1048 needs no typing. A movie has no frame numbers inside it, so there the count starts at 1.
    frame_countoptINT00–512How many frames to read as one batch, starting at the frame above. 0 is all frames to the end of the sequence or the movie, and 1 is a single image. A batch too large for memory is refused, and the error says how many fit.
    newest_byoptCOMBOversion number in the nameWhat newest means when several Versions match.
    filtersoptSTRINGExtra conditions in Flow Production Tracking's filter syntax, added to the fields above with AND, for example [["sg_ai_model", "contains", "flux"]]. For OR, use one group: {"logical_operator": "or", "conditions": [...]}. Leave it empty to let the fields above decide.
    pin_version_idoptINT00–2147483647Load this exact Version by id, ignoring all the fields above. 0 loads whatever those fields find.

    Outputs (6)

    NameTypeDescription
    imageIMAGEThe frames read from the Version, as a batch.
    videoVIDEOThe Version's clip, or its frames at the rate the site recorded.
    maskMASKThe frames' alpha, inverted the way Load Image does it. A source with no alpha gives a zero mask.
    version_idINTThe id of the Version read, for a node downstream to name.
    codeSTRINGThe name of the Version read.
    colour_spaceSTRINGThe colour space the publisher declared, empty when none was.