Skip to content

Repository files navigation

ComfyUI AutoDL API Nodes

English | 简体中文

Run ComfyUI workflow APIs published on AutoDL.Art from a local or remote ComfyUI installation.

Features

  • Select workflows from the AutoDL workflow catalog and synchronize their input/output schema.
  • Dynamically create typed ports for text, numbers, enums, images, audio, and video.
  • Submit and poll remote tasks, show their stage and elapsed time, and download temporary results into ComfyUI output storage.
  • Store the AutoDL token in ComfyUI settings instead of node or workflow JSON.
  • Automatically switch the node UI between English and Chinese using ComfyUI's Comfy.Locale setting.

The plugin registers two nodes under AutoDL/API:

  • AutoDL Workflow synchronizes inputs, submits a task, polls it, and saves returned files.
  • AutoDL Preview Video (no save) previews a video already saved by the workflow node without transcoding or creating another copy.

Installation

Clone the repository into custom_nodes:

cd ComfyUI\custom_nodes
git clone https://github.com/HappyAny/ComfyUI-AutoDL-API.git
cd ComfyUI-AutoDL-API
python -m pip install -r requirements.txt

Alternatively, download the repository ZIP and copy the complete folder to:

ComfyUI/custom_nodes/ComfyUI-AutoDL-API

Install dependencies with the Python environment used by ComfyUI, then fully restart ComfyUI.

Token configuration

The AutoDL ComfyUI API requires a token created in the ComfyUI group.

After installing and restarting ComfyUI:

  1. Press Ctrl + , to open ComfyUI Settings.
  2. Open AutoDL APIAuthentication.
  3. Paste the token into AutoDL ComfyUI Token.
  4. Close the settings panel. ComfyUI saves the value automatically.

The field is rendered as a password input. The token is not included in node or workflow JSON, but it is stored as plain text in the current ComfyUI user's settings file, usually:

ComfyUI/user/default/comfy.settings.json

Do not share this settings file, and restrict access to the ComfyUI user directory.

Headless or server mode

The environment variable remains available as a fallback:

$env:AUTODL_COMFY_TOKEN = "your ComfyUI token"
python .\main.py

Set it in the same process environment that starts ComfyUI. A token saved in ComfyUI Settings takes precedence over the environment variable.

Recommended workflow

  1. Save the token in ComfyUI Settings.
  2. Add an AutoDL Workflow node.
  3. Select a workflow from the AutoDL workflow dropdown. The list comes from the AutoDL ComfyUI workflow catalog.
  4. Selection synchronizes the workflow automatically. Click Sync workflow to refresh it manually. Use Enter ID / URL manually… only for workflows not present in the public catalog.
  5. Click Insert workflow demo to create and connect unconnected parameter nodes and currently visible media loaders. Enum parameters receive dropdowns, and numeric parameters use the declared minimum, maximum, and step. Result ports connect to suitable preview nodes. This button does not submit a task.
  6. The left and right ports follow the synchronized input_rules and output_example. Port labels stay compact; click Parameter help and options for required status, purpose, defaults, ranges, lengths, and enum values.
  7. Large media schemas start with at most 2 images + 1 audio + 0 videos visible. Use the compact −/+ controls on the right side to reveal or hide available media ports. Unsupported media types are not shown.
  8. Connect ComfyUI STRING, INT, FLOAT, BOOLEAN, IMAGE, AUDIO, or compatible media outputs to the corresponding inputs.
  9. Unconnected media inputs are omitted from the AutoDL request and do not enable platform defaults.
  10. Queue the workflow. The node submits the remote task, polls it to completion, and saves every result to ComfyUI/output/autodl_api/. Click Open result to open the first file.

The plugin remembers the most recently synchronized workflow. Its schema, visible media counts, workflow ID, and connections are stored with the ComfyUI workflow.

If an old workflow or cached frontend is missing the internal schema_json, the frontend automatically synchronizes it again. The backend can also rebuild the schema from workflow_id before submitting.

Inputs and outputs

An IMAGE input uses the first image in the batch and encodes it as a PNG Data URI. An AUDIO input is encoded as a WAV Data URI. Inline media is limited to 50 MB according to the current AutoDL rules. Video and generic media inputs accept compatible ComfyUI objects, HTTP(S) URLs, data: URIs, or server-local file paths.

Internal schema, timeout, and legacy advanced JSON controls are kept out of the node UI. They are injected into the prompt only when the workflow is queued.

Result ports follow the remote workflow:

  • Image results use IMAGE.
  • Audio results use AUDIO.
  • Video results use VIDEO.
  • Multiple entries in output_example create multiple result ports in order.

AutoDL result URLs are temporary, so AutoDL Workflow downloads the original result once into output/autodl_api/ before emitting a native media object. Connect a video to AutoDL Preview Video (no save) to preview that existing file. Use another Save Video node only when you need a different name, directory, container, or codec.

During execution, the status row shows submission, queueing, generation, download, and completion stages plus local elapsed time. If the API response includes duration, the node also shows the reported inference time. The plugin does not invent a percentage or ETA when the API does not provide one.

Language support

The frontend reads Comfy.Locale from ComfyUI Settings:

  • zh, zh-CN, and zh-TW use Chinese.
  • All other locales fall back to English.

Changing the ComfyUI language reloads the current workflow, which updates controls, status messages, parameter help, result labels, and demo node titles.

Important notes

  • Every Queue action submits a new remote task and may incur charges.
  • Result URLs are usually short-lived, so the node downloads all files when the task completes.
  • The current implementation sends a JSON request body and does not implement multipart uploads.
  • Polling occurs during node execution; the ComfyUI queue item remains active until the remote task completes or times out.
  • The default API root is https://www.autodl.art/api/v1/comfyui.
  • AUTODL_COMFY_API_BASE_URL can override the workflow-detail API for debugging, while AUTODL_COMFY_BASE_URL can override the task API.

Offline tests

The test suite does not submit real AutoDL tasks:

python -B -m unittest discover -s tests -v
node tests/test_frontend.mjs

Python tests cover the API client, schema mapping, media conversion, dynamic outputs, token fallback, and result previews. The Node test covers localization, hidden internal controls, and prompt injection.

References

License

MIT

About

ComfyUI nodes for running AutoDL.Art ComfyUI workflow APIs

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages