ATH-MaaS/Pixelle-Video · error · Exception

The workflow file does not exist: {workflow_path}

Error message

The workflow file does not exist: {workflow_path}

What it means

generate_audio_visual_video in web/pipelines/i2v.py resolves a workflow JSON under workflows/<workflow_key> and raises this Exception if the file does not exist, before attempting json.load. Fail-fast guard for a missing image-to-video workflow definition.

Source

Thrown at web/pipelines/i2v.py:312

                                video_path=media_result.url,
                                pipeline="image_to_video",
                                title="图生视频" if get_language() == "zh_CN" else "Image to Video",
                                input_params={
                                    "text": prompt,
                                    "prompt_text": prompt,
                                    "image_assets": audio_assets,
                                    "workflow_key": workflow_key,
                                    "api_video_params": api_video_params,
                                },
                            )
                            return media_result.url

                        kit = await pixelle_video._get_or_create_comfykit()

                        workflow_path = Path("workflows") / workflow_key

                        if not workflow_path.exists():
                            raise Exception(f"The workflow file does not exist: {workflow_path}")

                        with open(workflow_path, 'r', encoding='utf-8') as f:
                            workflow_config = json.load(f)

                        workflow_params = {
                            "image": image_path,
                            "prompt": prompt
                        }

                        if workflow_config.get("source") == "runninghub" and "workflow_id" in workflow_config:
                            workflow_input = workflow_config["workflow_id"]
                        else:
                            workflow_input = str(workflow_path)

                        video_result = await kit.execute(workflow_input, workflow_params)

                        generated_video_url = None
                        if hasattr(video_result, 'videos') and video_result.videos:

View on GitHub (pinned to 848b054e4f)

Solutions

  1. Check the path printed in the message; create or restore the missing workflow JSON there
  2. Fix the workflow_key being passed to generate_audio_visual_video to match an existing file
  3. Run from the repo root or anchor the path relative to the module: Path(__file__).parent / 'workflows'
  4. List the workflows/ directory and align filenames/casing exactly with the keys used in code

Example fix

// before
workflow_path = Path("workflows") / workflow_key
if not workflow_path.exists():
    raise Exception(f"The workflow file does not exist: {workflow_path}")
// after
WORKFLOWS_DIR = Path(__file__).resolve().parent.parent / "workflows"
workflow_path = WORKFLOWS_DIR / workflow_key
if not workflow_path.is_file():
    available = sorted(p.name for p in WORKFLOWS_DIR.glob("*.json"))
    raise FileNotFoundError(f"Workflow file missing: {workflow_path}. Available: {available}")
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path
workflow_path = Path("workflows") / workflow_key
if not workflow_key.endswith(".json") or not workflow_path.is_file():
    raise FileNotFoundError(f"Missing i2v workflow: {workflow_path.resolve()}")

Type guard

def workflow_available(key: str, base: Path = Path("workflows")) -> bool:
    return (base / key).is_file()

Try / catch

try:
    video = await generate_audio_visual_video(...)
except Exception as e:
    if "workflow file does not exist" in str(e):
        log.error("i2v workflow asset missing: %s", e)
    raise

Prevention

When it happens

Trigger: workflow_key (chosen by the caller/UI, e.g. 'i2v_wan2_1.json') does not correspond to a file in the workflows/ directory at runtime — key typo, workflow file not deployed, relative path resolved against a different CWD, or file removed/renamed.

Common situations: Adding a new i2v workflow option in the UI without committing the JSON; Docker/volume mount omitting workflows/; running the web app from another directory so Path('workflows') is empty; case-sensitive Linux filesystem vs Windows-named files; selecting a model variant whose workflow file was never bundled.

Related errors


AI-assisted analysis of ATH-MaaS/Pixelle-Video@848b054e4f (2026-08-30). Data as JSON: /api/errors/43caa6b5edfa52db. Report an issue: GitHub.