Skill: miemieeeee/comfyui-agent-skill-mie (version 1.0.0)

--- name: comfyui-agent-skill-mie description: > Agent skill for running registered ComfyUI workflows through a stable CLI. Supports image, video, music, and speech generation on a local or trusted self-hosted ComfyUI server (default http://127.0.0.1:8188). Registered workflows only. --- # comfyui-agent-skill-mie ## Purpose Run registered ComfyUI workflows through a stable Agent-facing CLI, with prompt enhancement, fail-fast errors, and structured JSON results. Use this skill when the user asks to: - Generate an image from text. - Generate a new image inspired by a reference image. - Edit an input image while preserving some structure or subject details. - Generate text-to-video or image-to-video MP4 output. - Generate music / instrumental / song-style MP3 output. - Synthesize spoken voice audio with Qwen3-TTS. - Check whether a ComfyUI server is available. Do not use this skill when the user only wants prompt writing, brainstorming, or discussion without actual generation. Do not use it when the ComfyUI server is unavailable. ## Hard Rules - Source mode: run CLI commands from the skill root (the directory containing `SKILL.md` and `scripts/`). - Tool-install mode: `comfyui-agent-skill-mie` / `comfyui-skill` can be run from any directory. - Source mode: use `uv run --no-sync python -m comfyui` (or `uv run --no-sync comfyui-skill`) for runtime calls. - Tool-install mode: use `comfyui-skill` (or `comfyui-agent-skill-mie`) directly; do not wrap with `uv run`. - Use registered workflows only. Do not run arbitrary unreviewed ComfyUI workflow JSON. - If server health fails, stop generation and return/handle `SERVER_UNAVAILABLE`; do not search disk for ComfyUI installs or guess ports. - Do not create or edit `config.local.json` unless the user explicitly wants a persistent server URL. For one-off runs, use `--server` or `COMFYUI_URL`. - For `reference_to_image`, inspect the reference image with Agent vision and create a prompt. Do not upload that reference image to ComfyUI. - For `image_to_image` and `image_to_video`, upload the provided local image with `--image`. - Analyzer-generated workflow configs require human review before activation. ## Setup Recommended install (tool-install mode): ```bash pipx install comfyui-agent-skill-mie ``` - Install package: `comfyui-agent-skill-mie` - Main command: `comfyui-agent-skill-mie` - Short alias: `comfyui-skill` Prerequisites: - ComfyUI server with `GET /system_stats` available. - Python 3.10+. - Source mode only: `uv`. - Required ComfyUI models/custom nodes for the selected workflow. Networking note: - Default local examples use `http://127.0.0.1:8188` for same-environment setups. - If the agent runs inside WSL/container/sandbox while ComfyUI runs on the host OS, `127.0.0.1` may refer to the runtime itself. Try `--server http://localhost:8188` or the host machine IP (and optionally persist it via `save-server`). Initial setup from the skill root: ```bash uv sync uv run --no-sync python -m comfyui --help ``` Tool-install mode: ```bash comfyui-agent-skill-mie --help comfyui-agent-skill-mie check comfyui-skill --help comfyui-skill check ``` ## Quick Workflow Choice Minimal decision tree: - User gives text only → `generate -p "..."` (defaults to `z_image_turbo`) - User gives a reference image and wants a new similar image → vision → `reference_to_image` prompt → run `z_image_turbo` - User gives an input image and wants edits → `generate --workflow klein_edit --image input_image=... -p "..."` - User wants TTS / voice audio → `generate --workflow qwen3_tts --speech-text "..." --instruct "..."` - User wants video → `ltx_23_t2v_distill` (text→video) or `ltx_23_i2v_distilled` (image→video) | User intent | Workflow / mode | Required command shape | |-------------|-----------------|------------------------| | Text to image | `z_image_turbo` default | `generate -p "prompt"` | | Qwen Image 2512 | `qwen_image_2512_4step` | `generate --workflow qwen_image_2512_4step -p "prompt"` | | Similar image from reference | Agent vision + T2I | Read reference image, create English prompt, then T2I | | Edit image | `klein_edit` | `generate --workflow klein_edit --image input_image=photo.png -p "edit prompt"` | | Text to video | `ltx_23_t2v_distill` | `generate --workflow ltx_23_t2v_distill -p "shot prompt"` | | Image to video | `ltx_23_i2v_distilled` | `generate --workflow ltx_23_i2v_distilled --image input_image=photo.png -p "motion prompt"` | | Text to music | `ace_step_15_music` | `generate --workflow ace_step_15_music -p "music tags"` | | Text to speech | `qwen3_tts` | `generate --workflow qwen3_tts --speech-text "..." --instruct "..."` | For workflow-specific size rules, capability boundaries, and examples, read [references/workflows.md](references/workflows.md). ## Core Commands Environment doctor (check server + preflight registered workflows): Tool-install mode: ```bash comfyui-skill doctor ``` Source mode: ```bash uv run --no-sync python -m comfyui doctor ``` If it exits with code 0, the environment is ready for all checked workflows. Exit code 1 means missing nodes/models or server is unreachable (see JSON payload). Health check: ```bash uv run --no-sync python -m comfyui check ``` Tool-install mode: ```bash comfyui-skill check ``` Generate an image: ```bash uv run --no-sync python -m comfyui generate -p "a cute cat sitting on a windowsill at golden hour" ``` Tool-install mode: ```bash comfyui-skill generate -p "a cute cat sitting on a windowsill at golden hour" ``` Generate with a specific workflow and server: ```bash uv run --no-sync python -m comfyui generate --workflow z_image_turbo --server http://192.168.1.100:8188 -p "a landscape" ``` Save a persistent server URL only when the user asks for it: ```bash uv run --no-sync python -m comfyui save-server http://192.168.1.100:8188 ``` Preflight a workflow before a long run: ```bash uv run --no-sync python -m comfyui generate --workflow qwen_image_2512_4step --preflight ``` Show progress for long jobs: ```bash uv run --no-sync python -m comfyui generate --workflow ltx_23_t2v_distill -p "cinematic waves at sunset, slow pan" --progress ``` Full CLI options, output path behavior, async submit/poll, and error code details are in [references/cli.md](references/cli.md). ## Prompt Enhancement Before generation, convert the user's intent into the right workflow inputs. | Type | Read this file | Use when | |------|----------------|----------| | `character` | [references/prompt_enhancement/character.md](references/prompt_enhancement/character.md) | Portrait, person, character, figure photo | | `reference_to_image` | [references/prompt_enhancement/reference_to_image.md](references/prompt_enhancement/reference_to_image.md) | User provides a reference image and wants a new similar image | | `image_to_image` | [references/prompt_enhancement/image_to_image.md](references/prompt_enhancement/image_to_image.md) | User provides an input image and wants to edit it | | `text_to_speech` | [references/prompt_enhancement/text_to_speech.md](references/prompt_enhancement/text_to_speech.md) | User gives a short voice description and needs full Qwen3-TTS instruction | Reference-to-image flow: 1. Ensure a usable reference image exists; otherwise return Agent error `NO_REFERENCE_IMAGE`. 2. Ensure this runtime can inspect images; otherwise return Agent error `VISION_UNAVAILABLE`. 3. Read the reference prompt enhancement file and create one English prompt. 4. Call T2I generation with that prompt. Do not pass the reference image to ComfyUI. Image-to-image flow: 1. Ensure a local image path is available. 2. Read the image edit prompt enhancement file. 3. Call `klein_edit` with `--image input_image=path`. Text-to-speech flow: 1. Split user intent into spoken content and voice/style instruction. 2. Read the TTS prompt enhancement file. 3. Call `qwen3_tts` with `--speech-text` and `--instruct`; do not use positional prompt. ## Fail-Fast and Recovery CLI failures are structured JSON on stdout. Agent-only pre-check failures for reference images should also be JSON. Agent-only error shape: ```json { "source": "agent", "success": false, "error": {"code": "VISION_UNAVAILABLE", "message": "Cannot read reference image in this runtime."} } ``` Required fail-fast behavior: - Missing prompt: return/handle `EMPTY_PROMPT`. - Unregistered workflow: return/handle `WORKFLOW_NOT_REGISTERED`. - Server unavailable: return/handle `SERVER_UNAVAILABLE` and ask whether ComfyUI is running locally or on another machine. - Missing reference image before `reference_to_image`: return Agent error `NO_REFERENCE_IMAGE`; do not call CLI. - No vision for `reference_to_image`: return Agent error `VISION_UNAVAILABLE`; do not call CLI. - Missing image for image workflows: return/handle `NO_INPUT_IMAGE` or `INPUT_IMAGE_NOT_FOUND`. - Missing custom nodes/models during preflight: return/handle `PREFLIGHT_MISSING_NODES` or `PREFLIGHT_MISSING_MODELS`. When the user provides a remote ComfyUI address, save it only if they want persistence: ```bash uv run --no-sync python -m comfyui save-server http://<address>:<port> ``` Otherwise retry the original command with `--server http://<address>:<port>`. ## Output Handling After successful generation, present the result to the user. Do not silently parse JSON and stop. - For images, display the file when the runtime supports local image display; otherwise provide the absolute/local path from `outputs[].path`. - For MP3/MP4, provide the path or use the runtime's media display/playback capability when available. - Prefer omitting `--output`; the CLI writes to a per-job directory under `results/` and returns exact paths in JSON. - For `--count > 1`, parse the wrapper object and present each result. See [references/cli.md](references/cli.md) for JSON schemas and output directory rules. ## References - [references/workflows.md](references/workflows.md) — workflow selection, capabilities, size rules, examples. - [references/cli.md](references/cli.md) — CLI contract, async jobs, output paths, JSON schemas, error codes. - `references/prompt_enhancement/` — prompt enhancement instructions.

path: assets/workflows/ace_step_15_music.config.json
content: {
  "workflow_id": "ace_step_15_music",
  "workflow_file": "ace_step_15_music.json",
  "output_node_title": "Save Audio (MP3)",
  "capability": "text_to_music",
  "description": "Ace Step 1.5 music generation to MP3 (tags + optional lyrics)",
  "size_strategy": "workflow_managed",
  "output_kind": "audio",
  "node_mapping": {
    "prompt": {
      "node_title": "TextEncodeAceStepAudio1.5",
      "param": "tags",
      "value_type": "string",
      "required": true
    },
    "lyrics": {
      "node_title": "TextEncodeAceStepAudio1.5",
      "param": "lyrics",
      "value_type": "string"
    },
    "seed": {
      "node_title": "TextEncodeAceStepAudio1.5",
      "param": "seed",
      "value_type": "integer",
      "auto_random": true
    }
  }
}


path: assets/workflows/ace_step_15_music.json
content: {
  "3": {
    "inputs": {
      "seed": 31,
      "steps": 8,
      "cfg": 1,
      "sampler_name": "euler",
      "scheduler": "simple",
      "denoise": 1,
      "model": [
        "78",
        0
      ],
      "positive": [
        "94",
        0
      ],
      "negative": [
        "47",
        0
      ],
      "latent_image": [
        "98",
        0
      ]
    },
    "class_type": "KSampler",
    "_meta": {
      "title": "KSampler"
    }
  },
  "18": {
    "inputs": {
      "samples": [
        "3",
        0
      ],
      "vae": [
        "97",
        2
      ]
    },
    "class_type": "VAEDecodeAudio",
    "_meta": {
      "title": "VAE Decode Audio"
    }
  },
  "47": {
    "inputs": {
      "conditioning": [
        "94",
        0
      ]
    },
    "class_type": "ConditioningZeroOut",
    "_meta": {
      "title": "ConditioningZeroOut"
    }
  },
  "78": {
    "inputs": {
      "shift": 3,
      "model": [
        "97",
        0
      ]
    },
    "class_type": "ModelSamplingAuraFlow",
    "_meta": {
      "title": "ModelSamplingAuraFlow"
    }
  },
  "94": {
    "inputs": {
      "tags": "A cinematic and epic orchestral track that builds intense momentum for a grand narrative. The piece opens with deep, thunderous percussion and rhythmic taiko drums, layering in staccato strings and a powerful brass section that conveys a sense of heroic duty. As the arrangement swells, soaring choral chants and sweeping violins create a feeling of sacrifice and ultimate glory. The production is vast and atmospheric, featuring high dynamic range and a driving, march-like energy perfect for a high-stakes battle or a dramatic trailer climax, evoking a mood of solemnity and triumphant resilience.",
      "lyrics": "[en]\n[Intro]\n(Low brass hum, distant drums pounding)\nThe shadows rise across the ancient land.\n\n[Verse 1]\nThrough the ashes of the fallen sky\nWe march beneath the banners held on high\nNo turning back, the embers start to glow\nAgainst the tide where silver rivers flow\nThe weight of crowns, the cost of every breath\nWe walk the line between the light and death.\n\n[Chorus]\nRise from the silence, the glory and the pain\nFor every hero born in iron and rain\nThe world will tremble, the heavens will cry\nOur names are written in the burning sky\nEternal fire, the spirit never dies.\n\n[Verse 2]\nThe sword is heavy but the will is strong\nWe carry echoes of a forgotten song\nBeyond the gates where destiny awaits\nWe challenge gods and master our own fates\nA single spark to light the darkest night\nThe final stand, the dawn of holy light.\n\n[Chorus]\nRise from the silence, the glory and the pain\nFor every hero born in iron and rain\nThe world will tremble, the heavens will cry\nOur names are written in the burning sky\nEternal fire, the spirit never dies.\n\n[Outro]\n(Epic choral swell)\nVictory... in the silence...\nGlory... remains.\n(Final thunderous drum hit)",
      "seed": 31,
      "bpm": 105,
      "duration": 120,
      "timesignature": "2",
      "language": "en",
      "keyscale": "D minor",
      "generate_audio_codes": true,
      "cfg_scale": 2,
      "temperature": 0.85,
      "top_p": 0.9,
      "top_k": 0,
      "min_p": 0,
      "clip": [
        "97",
        1
      ]
    },
    "class_type": "TextEncodeAceStepAudio1.5",
    "_meta": {
      "title": "TextEncodeAceStepAudio1.5"
    }
  },
  "97": {
    "inputs": {
      "ckpt_name": "Ace_Step_1.5\\ace_step_1.5_turbo_aio.safetensors"
    },
    "class_type": "CheckpointLoaderSimple",
    "_meta": {
      "title": "Load Checkpoint"
    }
  },
  "98": {
    "inputs": {
      "seconds": 120,
      "batch_size": 1
    },
    "class_type": "EmptyAceStep1.5LatentAudio",
    "_meta": {
      "title": "Empty Ace Step 1.5 Latent Audio"
    }
  },
  "104": {
    "inputs": {
      "filename_prefix": "audio/ace-step-1.5",
      "quality": "128k",
      "audioUI": "",
      "audio": [
        "18",
        0
      ]
    },
    "class_type": "SaveAudioMP3",
    "_meta": {
      "title": "Save Audio (MP3)"
    }
  }
}

path: assets/workflows/klein_edit.config.json
content: {
  "workflow_id": "klein_edit",
  "workflow_file": "klein_edit.json",
  "output_node_title": "Save Image",
  "capability": "image_to_image",
  "description": "Flux2-Klein image editing: upload an image, edit via prompt while preserving pose, structure and composition",
  "size_strategy": "workflow_managed",
  "node_mapping": {
    "input_image": {
      "node_title": "Load Image",
      "param": "image",
      "value_type": "image",
      "input_strategy": "upload",
      "required": true
    },
    "prompt": {
      "node_title": "CLIP Text Encode (Positive Prompt)",
      "param": "text",
      "value_type": "string",
      "required": true
    },
    "negative_prompt": {
      "node_title": "CLIP Text Encode (Negative Prompt)",
      "param": "text",
      "value_type": "string"
    },
    "seed": {
      "node_title": "KSampler",
      "param": "seed",
      "value_type": "integer",
      "auto_random": true
    }
  }
}


path: assets/workflows/ltx-23-i2v.config.json
content: {
  "workflow_id": "ltx-23-i2v",
  "workflow_file": "ltx-23-i2v.json",
  "output_node_title": "Video Combine (Primary MP4)",
  "capability": "image_to_video",
  "description": "LTX-2.3 dev image-to-video: output resolution follows uploaded image. Do NOT use CLI --width/--height.",
  "output_kind": "video",
  "resolution_presets": {},
  "default_resolution": "",
  "node_mapping": {
    "input_image": {
      "node_title": "Load Image",
      "param": "image",
      "value_type": "image",
      "input_strategy": "upload",
      "required": true
    },
    "prompt": {
      "node_title": "CLIP Text Encode (Positive Prompt)",
      "param": "text",
      "value_type": "string",
      "required": true
    },
    "negative_prompt": {
      "node_title": "CLIP Text Encode (Prompt)",
      "param": "text",
      "value_type": "string"
    }
  }
}

path: scripts/comfy_api_simplified/__init__.py
content: """
Vendored subset of comfy_api_simplified for comfyui-skill.
See VENDORING.md for upstream URL, license, and commit.
"""
from .api import ComfyApi, ComfyApiWrapper
from .exceptions import (
    ComfyApiError,
    ConnectionError,
    ExecutionError,
    NodeNotFoundError,
    PromptCategoryError,
)
from .workflow import ComfyWorkflowWrapper, Workflow

__all__ = [
    "ComfyApi",
    "ComfyApiWrapper",
    "ComfyApiError",
    "ConnectionError",
    "ExecutionError",
    "NodeNotFoundError",
    "PromptCategoryError",
    "Workflow",
    "ComfyWorkflowWrapper",
]

__version__ = "1.3.0"


path: scripts/comfyui/models/__init__.py
content: from .result import GenerationResult

__all__ = ["GenerationResult"]


path: scripts/comfyui_agent_skill_mie.egg-info/dependency_links.txt
content: 


path: scripts/comfyui_skill.egg-info/dependency_links.txt
content: 


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: suspicious (CRITICAL)