Haoran 万相API配置
The Haoran 万相API配置 node is just a named constant for your DashScope key
- api_config
Let's get the obvious thing out of the way: despite the name, HaoranWanxAPILoader doesn't load anything and it doesn't call any API. It packages up connection settings - model name, endpoint, API key - into a WANX_API object that you hand to the pack's main node. It's the same pattern as comfyui_LLM_party's LLM loader, minus the drama: think of it as a named constant on the canvas so you don't retype your key into every node.
It's the least glamorous node in the pack, and that's fine. Where it earns its keep is scale: wire one loader to several Haoran 通义万相图像编辑 nodes and you change your key in one place instead of hunting through a workflow. If you only run a single edit node, it's genuinely optional - the main node accepts a bare api_key or falls back to the DASHSCOPE_API_KEY environment variable on its own. The loader is the "organize it properly" path, not the "required to work" path.
Inputs and output
All three inputs are required, but you'll only really touch two of them:
- model_name - an enum with exactly one choice,
wanx2.1-imageedit. It's a dropdown with one item, which is ComfyUI's way of letting a future model drop into the same node. Leave it. - base_url - defaults to Alibaba's DashScope image-synthesis endpoint, and the default is right for ~all of you. Edit it only if you're hitting a proxy or a compatible third-party endpoint.
- api_key - your
sk-key. Leave it blank and the loader pulls from theDASHSCOPE_API_KEYenvironment variable, which is the recommended setup anyway (it keeps secrets out of saved workflows).
The single output, api_config (WANX_API), is a small dictionary holding those three values. It plugs into the main edit node's api_config input. Nothing leaves your machine at this stage - the loader is pure local bookkeeping; the actual upload happens when the edit node runs.
Install and gotchas
It ships in the same pack as the edit node, so there's no separate install. Via ComfyUI Manager, search "ComfyUI-HaoranWanxImageEdit"; or:
cd ComfyUI/custom_nodes
git clone https://github.com/GonDesign/ComfyUI-HaoranWanxImageEdit
cd ComfyUI-HaoranWanxImageEdit
pip install -r requirements.txt
Restart ComfyUI and it appears under the 昊然 category. Dependencies are just requests, Pillow, and numpy - nothing heavy.
Two small things to know. First, the loader never validates your key - you can wire a garbage key through it and only find out when the edit node runs and the API answers with an auth error. Second, if you fill in api_key here and on the edit node, the edit node's own field wins; the loader is consulted only when the node's direct key is blank. So if you think you've set a key in the loader and edits still fail, check the edit node for a stale key left over from experimenting.
It's a five-second setup node, but it's the difference between "where do I change this key" and knowing exactly where. For anything beyond a one-off workflow, use it.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| model_name | COMBO | wanx2.1-imageedit | 1 options: wanx2.1-imageedit |
| base_url | STRING | https://dashscope.aliyuncs.com/api/v1/services/aigc/image2image/image-synthesis | — |
| api_key | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| api_config | WANX_API | — |