Nodes/Wan27/Wan27 Estimate Credits
ComfyUI Node

Wan27 Estimate Credits

Get the price in writing before the expensive node runs

By NotUsingGithub·Created 23 days ago·Updated 23 days ago· 0
Wan27 Estimate Credits
    • review_json
    • estimated_credits
    ◄generation_input_json{"modelId":"wan2.7-image","prompt":"A paper crane on a desk","resolution":"2K"}►

    Every "generate" button in this ecosystem has the same failure mode: you find out what it cost after it ran. Wan27Estimate is the pack's answer to that - a free quote you get before anything is charged, in a form the next node will actually accept.

    Context you need: this is a wrapper around Wan 2.7, which is a hosted service with no downloadable weights. Alibaba stopped shipping open checkpoints after Wan 2.2, so 2.5, 2.6 and 2.7 are API-only - which puts this squarely in the "cloud call for a model you cannot run" category, with all the usual tradeoffs: per-call cost, your prompts leaving the machine, and a filter you can't touch. The quoted price is the part people actually want to know, and credit-based pricing on these services climbs faster than anyone expects. Hence a dedicated node for it.

    What it does under the hood

    You hand it a generation request as JSON. It POSTs that object to the service's estimate endpoint - no task is created, no credits are spent - reads the returned credits value, and then does the interesting bit: it builds a receipt.

    The receipt is {"version": 1, "input": <your object>, "inputDigest": <sha256>, "estimatedCredits": <number>}. The digest is a SHA-256 over your input serialised with sorted keys and no whitespace - which means reformatting or reordering your JSON leaves it unchanged, but changing a single value breaks it. That digest is how the Submit node later proves the thing it's generating matches the thing you reviewed.

    Inputs and outputs

    There's exactly one input: generation_input_json, a multiline STRING, pre-filled with the author's worked example:

    {"modelId":"wan2.7-image","prompt":"A paper crane on a desk","resolution":"2K"}
    

    Trust the shape, not the values. The README is explicit that model parameters and prices are discovered at runtime rather than assumed from that example prompt, and this is where people waste a request: they copy the sample, swap the prompt, and the service rejects a field the model doesn't have. Run the Account and Models node first with a model_id and read the returned schema. That's the authoritative list of what you're allowed to send.

    Two outputs. review_json is the receipt as a string - wire it straight into Wan27 Submit Generation's review_json input, don't retype it. estimated_credits is a FLOAT, which is the number you actually want on screen before you decide anything; park it in a preview so it's visible in the run, not buried in a log.

    Keep the JSON an object and under 32 KiB. Arrays get rejected ("Provide a JSON object"), and non-finite numbers are refused at parse time, so a stray NaN copied from somewhere gets you "Provide a valid JSON object" rather than a confusing HTTP error.

    Install

    Manager, search "Wan27", install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/NotUsingGithub/ComfyUI-Wan27.git
    

    No dependencies - the client is pure stdlib urllib, pyproject.toml is empty on purpose, and nothing is downloaded. The only setup is the token in the ComfyUI process environment:

    export WAN27_ACCESS_TOKEN="your-token-here"
    

    Restart ComfyUI from that shell, or the environment isn't there to read. The service is subscription-gated, so a valid-looking token on a lapsed account will fail at this node rather than the expensive one - which is the good version of that failure.

    Gotchas worth knowing

    Estimating is free, but not free of consequence. This node also opts out of ComfyUI's cache, so every Queue press re-quotes the service. That's the behaviour you want (prices change, and the Submit node re-checks anyway), but it's an HTTP round-trip each run, not a memo.

    The estimate can move. Prices and parameters are runtime data. If the quote changed between your review and your submit, the Submit node refuses and tells you to review again. That's not a bug to work around - re-estimate, look at the new number, and decide whether you still want it.

    A receipt is bound to its input. Editing the JSON after you estimated doesn't get you a new quote; it gets you a digest mismatch at submit time. Re-run this node after every change.

    Your request text ends up in ComfyUI history, so a prompt you wouldn't post publicly is still a prompt in a workflow someone can open. Same rule as every API node in this space: whatever you send leaves your machine, and it leaves a local copy too.

    The honest framing on this one: the node is trivial, the discipline it enforces isn't. Two clicks of friction between you and a spend, and you'll never learn a generation's cost from your credit balance again.

    CategoryWan27

    Inputs (1)

    NameTypeDefaultDescription
    generation_input_jsonSTRING{"modelId":"wan2.7-image","prompt":"A paper crane on a desk","resolution":"2K"}—

    Outputs (2)

    NameTypeDescription
    review_jsonSTRING—
    estimated_creditsFLOAT—