Nodes/ComfyUI-nkxx/🍌 Nano Banana 异步查询与下载 (Grsai)
ComfyUI Node

🍌 Nano Banana 异步查询与下载 (Grsai)

This is what actually hands you the image

By nkxx188·Created 11 months ago·Updated 6 months ago· 14
🍌 Nano Banana 异步查询与下载 (Grsai)
    • image
    • status
    api_key

    If NanoBananaAsyncSubmit is the front door, this is the pickup window. It takes zero inputs (well, an optional api_key, left blank to fall back to the pack-wide Grsai key), scans the local task database for anything still running, polls the Grsai API for fresh status, and downloads the first finished image it finds. That's the whole deal - and it's exactly what you want in a workflow where you submit a batch, run a local job, then come back and collect.

    The outputs:

    • image - an IMAGE tensor, so you can wire it straight into a preview node, a SaveImage, or - the reason most people are here - into a local video model as a first frame. The KB's google.json calls the Nano-Banana-generate / Wan-animate pattern a standard move in 2026 workflows, and this is the API side of that handoff.
    • status - a multiline report showing every task in the queue: [运行中] 任务1 (一只可爱的小猫...) - 2个子任务 style lines, with 成功/失败 counts for batch jobs, and "当前无任务记录" if the database is empty.

    Mechanically, the node is honest about being a poller. Each run refreshes every active task (it hits /v1/draw/result per subtask), then grabs the oldest task that has finished and downloads its image. Because the node classes force a re-run on every graph execution (IS_CHANGED returns NaN), just hitting Queue again acts as "poll me more" - you don't need to fiddle with anything. That's the rhythm: queue the query node, wait, queue it again, repeat until your status says 待下载 and the image shows up.

    A couple of grounded gotchas:

    • It only surfaces one image per run (the first succeeded one), even though a concurrency-10 submit makes ten. Run the query node repeatedly - or wire it into a loop - to drain a batch.
    • The database lives at <pack>/data/grsai_banana_async_history.json. It's the same file the submit node writes to, and it survives restarts, so your jobs don't evaporate when ComfyUI dies mid-generation. If you ever want to nuke the history, that's the file.
    • If there's nothing to download, you get an empty-ish status line and a 1×1 placeholder image, not an error. Don't panic at the black pixel - it's the "nothing ready" sentinel.

    Install is the pack-wide one: ComfyUI Manager and search "ComfyUI-nkxx", or clone https://github.com/jieg9341-lab/ComfyUI-nkxx into custom_nodes/ and restart (it auto-installs its Python deps on first boot). You need a Grsai API key from nkxx.grsai.ai - the node reads it from its own field, the GRSAI_KEY environment variable, or the pack's global key manager.

    The natural pairing is submit → (do anything else, or queue the query a few times) → query → preview/save. For one-off single images the sync GrsaiNanoBanana node is simpler, but the moment you're running concurrency or batches, this is the node that keeps your graph from locking up waiting on Google.

    CategoryNkxx/Grsai/图像异步

    Inputs (1)

    NameTypeDefaultDescription
    api_keyoptSTRING

    Outputs (2)

    NameTypeDescription
    imageIMAGE
    statusSTRING