一键导入
comfyui-payload-sanitization-protocol
Protocol for cleaning LLM-generated or metadata-enriched JSON payloads to ensure compatibility with the ComfyUI API.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Protocol for cleaning LLM-generated or metadata-enriched JSON payloads to ensure compatibility with the ComfyUI API.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
A specialized AI agent that ruthlessly evaluates all marketing assets against world-class standards, ensuring only premium content is approved for final delivery.
A specialized framework for generating high-fidelity prompts optimized for Flux.2 (image) and LTX 2.5 (video). Focuses on materiality, optical physics, temporal dynamics, and cinematic technicality to move beyond "vibe-coded" descriptions.
Automates the transformation of narrative Markdown prompts into technical JSON payloads for Z-Image Turbo ComfyUI workflows. Handles extraction, sanitization against banned terms, and dynamic parameter injection (Resolution/Node Targeting).
Transforms narrative script data into cinematic prompt batches for FLUX/LTX.
Expert-tier prompting protocol for Grok Imagine Video Generation (xAI). Focuses on 'Hollywood sequence' narrative prose, SCENE LOCK consistency, and handheld realism.
High-precision prompting protocol for LTX 2.3 (Lightricks) video generation, optimized for ComfyUI VFX pipelines and local control. Incorporates cinematic prose, camera motion selectors, and the community-standard 3-stage sampling hack.
| name | comfyui-payload-sanitization-protocol |
| description | Protocol for cleaning LLM-generated or metadata-enriched JSON payloads to ensure compatibility with the ComfyUI API. |
This skill provides a standardized procedure for preparing JSON payloads for the ComfyUI API when they have been generated by LLMs or enriched with metadata.
LLMs often include descriptive metadata (e.g., _meta, description, anchor_id) within the JSON structure to help human agents track tasks. However, the ComfyUI /prompt endpoint is strictly schema-validated and will reject any payload containing keys not defined in the original workflow.
Use this protocol when submitting payloads generated via script or LLM that result in a 400 Bad Request error from the ComfyUI server, specifically citing unexpected keys.
_meta, anchor_id, or custom descriptive fields).import json
def sanitize_payload(base_workflow, enriched_payload):
"""
Merges enriched data into a clean base workflow to ensure
no non-standard metadata keys remain.
"""
# Create a deep copy of the clean structure
clean_payload = json.loads(json.dumps(base_workflow))
# Extract only the valid node updates from the enriched payload
for node_id, node_data in enriched_payload.items():
if node_id in clean_payload:
# Remove any metadata at the top level of the enriched node
# before updating the clean structure
if isinstance(node_data, dict):
node_data.pop('_meta', None)
clean_payload[node_id].update(node_data)
return clean_payload
# Usage
with open('base_workflow.json', 'r') as f:
base = json.load(f)
with open('enriched_batch.json', 'r') as f:
enriched = json.load(f)
sanitized = sanitize_payload(base, enriched)
pop() on the top level may not be enough; a recursive key removal function is safer for complex nodes.