Nodes/ComfyUI-ADIC/营销图生图任务(带轮询)
ComfyUI Node

营销图生图任务(带轮询)

Submit a marketing-image job, then babysit it until it's done

By jinchanz·Created about a year ago·Updated a day ago· 5
营销图生图任务(带轮询)
    • result
    • task_id
    • status
    generate_params
    app_nameNHCI
    api_key
    user_id
    base_urlhttps://pre-zhimei.alibabadesign.com
    poll_interval5
    max_poll_time300
    auto_start_pollingtrue

    Some cloud image services don't answer with a picture; they answer with a task ID and make you check back until the job finishes. That's the model MarketImageGenerateWithPolling wraps: it submits a marketing-image generation job to Alibaba Design's 智美-style service, then polls the status endpoint on a timer until the image is ready. For a batch of advertising/marketing creatives generated server-side, this is the "fire and wait" node.

    The mechanism is a two-phase HTTP dance, all under the hood. First it POSTs your generate_params JSON to {base_url}/open/api/v1/ai/marketImageGenerate with Bearer auth, and the response's data field becomes your task_id. Then it loops, POSTing a query to {base_url}/open/api/v1/ai/getMainTask every poll_interval seconds (default 5) until the status hits a terminal state - SUCCESS/COMPLETED/FINISHED for done, FAILED/ERROR/CANCELLED for dead - or until max_poll_time (default 300s) runs out. You can set auto_start_polling to false to stop after task creation and poll elsewhere with the returned task_id.

    The inputs you need

    • generate_params - required, the JSON body describing the marketing image job. This is service-specific; you need the 智美 API's schema.
    • api_key - required Bearer key.
    • user_id - required; the query payload includes it.
    • app_name - default NHCI, the X-App-Name header.
    • base_url - here's the gotcha: the default is https://pre-zhimei.alibabadesign.com. That's a pre-production host (the "pre-" is the tell). If you're pointing at the real service, this almost certainly needs changing to your actual environment.
    • poll_interval (1–60s), max_poll_time (30–1800s), auto_start_polling.

    Outputs

    • result - the full task response JSON when complete, or an error/timeout JSON otherwise.
    • task_id - for resuming/querying elsewhere.
    • status - a clean string: created, completed, failed, timeout, or error. This is the field to branch on.

    The honest trade-offs

    This node blocks your workflow while polling - the queue won't advance for up to max_poll_time, and the node returns a timeout status if the job outlives the budget. For slow marketing renders (which are often 30s+ server-side), set max_poll_time generously or you'll get a timeout result with a valid task_id you can check manually. Also, like every API node in this pack, it uses verify=False (no SSL verification) and the README doesn't document it at all - this one is squarely an internal tool that happened to be open-sourced.

    Installing

    cd ComfyUI/custom_nodes
    git clone https://github.com/jinchanz/ComfyUI-ADIC
    

    Restart ComfyUI, or install "ComfyUI-ADIC" via ComfyUI Manager. requests only, no model downloads. Realistically: without a valid key and user_id on the 智美 service (and the right base_url), this node errors out fast - it's the most environment-specific node in the pack.

    CategoryMalette

    Inputs (8)

    NameTypeDefaultDescription
    generate_paramsSTRING
    app_nameSTRINGNHCI
    api_keySTRING
    user_idSTRING
    base_urlSTRINGhttps://pre-zhimei.alibabadesign.com
    poll_intervaloptINT51–60
    max_poll_timeoptINT30030–1800
    auto_start_pollingoptBOOLEANtrue

    Outputs (3)

    NameTypeDescription
    resultSTRING
    task_idSTRING
    statusSTRING