clean up and docs

This commit is contained in:
Steve Tietze
2026-01-09 15:25:46 +07:00
parent 194e37b64d
commit 82008b0027
4 changed files with 60 additions and 32 deletions
+26 -28
View File
@@ -1,34 +1,32 @@
# ComfyUI KIE API Integration
# ComfyUI KIE API Nodes
ComfyUI custom nodes for the KIE API (image and video generation).
## Project overview
This repository provides a set of ComfyUI custom nodes that connect to the Kie.ai API for image and video generation workflows.
## Installation
- Clone or copy this repository into `ComfyUI/custom_nodes/ComfyUI-Kie-API`.
- Restart ComfyUI so it discovers the node package.
## Why this exists
ComfyUI users often need reliable, reusable API-backed nodes that mirror model capabilities while staying easy to update and maintain. This pack focuses on clear inputs, consistent outputs, and practical workflow integration.
## API Key Setup
- Copy `config/kie_key.example.txt` to `config/kie_key.txt`.
- Paste your KIE API key into `config/kie_key.txt` (this file is gitignored).
- Keep the key file alongside the repo so future nodes can read it.
## What’s included
- Image generation nodes
- Image-to-video and text-to-video nodes
- Utility helpers for grid slicing and prompt parsing
## Nodes
- KIE Get Remaining Credits
- KIE Nano Banana Pro (Image)
- KIE Seedream 4.5 Text-To-Image
- KIE Seedream 4.5 Edit
- KIE Seedance V1 Pro Fast (I2V)
- KIE Seedance 1.5 Pro (I2V/T2V)
- KIE Kling 2.6 (I2V/T2V)
- KIE Kling 2.6 (T2V)
- KIE Kling 2.6 Motion-Control (I2V)
- KIE Grid Slice
- KIE Parse Prompt Grid JSON (1..9)
Node-specific documentation is available in `web/docs`.
## Usage
- Drop a KIE node into your ComfyUI workflow and connect inputs.
- For video outputs, connect the VIDEO output to the SaveVideo node.
- Public node documentation lives in `web/docs`.
## About Kie.ai
Kie.ai is a unified API and model marketplace for image, video, and audio generation. This project is community-maintained and not affiliated with Kie.ai. Learn more at https://kie.ai/.
## Documentation
- See `web/docs` for per-node details and parameter lists.
- Development-only notes and tooling configs are not shipped in this repo.
## Credits and usage
Kie.ai uses a credit-based model for requests. There is no subscription requirement, and small funding amounts are supported for pay-as-you-go usage.
## Debugging and job visibility
You can review request history and results at https://kie.ai/logs.
## Project status
Early release. Interfaces may evolve as the Kie.ai API changes or additional nodes are added.
## Feedback / contributions
Issues and pull requests are welcome. Please include clear repro steps for bugs and keep changes focused.
## License
TBD. Add your preferred license file and update this section accordingly.
+8 -2
View File
@@ -20,7 +20,11 @@ def _extract_prompt_index(key: Any) -> int | None:
normalized = key.strip().lower()
if not normalized:
return None
match = re.search(r"(\\d+)$", normalized) or re.search(r"(\\d+)", normalized)
prompt_match = re.match(r"^\\s*(?:p|prompt)\\s*[_\\-\\s]*([1-9]\\d*)\\s*$", normalized, re.IGNORECASE)
if prompt_match:
match = prompt_match
else:
match = re.match(r"^\\s*([1-9]\\d*)\\s*$", normalized)
if not match:
return None
try:
@@ -76,5 +80,7 @@ def parse_prompts_json(text: str, max_items: int = 9, strict: bool = False) -> l
prompts = prompts[:max_items]
if not prompts and strict:
raise ValueError("No prompts found in json_text.")
raise ValueError(
"No prompts found in json_text. Supported keys: prompts (array), prompt1/prompt_1/p1, numeric keys."
)
return prompts
+17 -2
View File
@@ -582,7 +582,19 @@ Outputs:
"INT",
"STRING",
)
RETURN_NAMES = ("p1", "p2", "p3", "p4", "p5", "p6", "p7", "p8", "p9", "count", "prompts_list")
RETURN_NAMES = (
"prompt 1",
"prompt 2",
"prompt 3",
"prompt 4",
"prompt 5",
"prompt 6",
"prompt 7",
"prompt 8",
"prompt 9",
"count",
"prompts_list",
)
FUNCTION = "parse"
CATEGORY = "kie/helpers"
@@ -606,7 +618,10 @@ Outputs:
prompts = [fallback]
if not prompts:
raise ValueError("No prompts found in json_text and no default_prompt provided.")
raise ValueError(
"No prompts found in json_text and no default_prompt provided. "
"Supported keys: prompts (array), prompt1/prompt_1/p1, numeric keys."
)
padded = prompts[:9] + [""] * (9 - len(prompts))
count = len(prompts)
+9
View File
@@ -33,6 +33,15 @@ Object format (keyed prompts):
}
```
Object format (underscore keys):
```
{
"prompt_1": "Prompt 1",
"prompt_2": "Prompt 2",
"prompt_3": "Prompt 3"
}
```
---
## Outputs