Comfy-Org/ComfyUI · error · ValueError

--{i} is not allowed in the prompt, use the appropriated wid

Error message

--{i} is not allowed in the prompt, use the appropriated widget input to change this value.

What it means

Raised by raise_if_text_params (nodes_bytedance.py:1978), called by the Seedance video nodes, when the prompt string contains a '--<param> ' fragment for any of the parameters the node already injects itself (resolution, ratio, duration, seed, camerafixed, watermark). The node appends these as command-style flags to the prompt, so user-supplied duplicates would conflict or inject arbitrary values.

Source

Thrown at comfy_api_nodes/nodes_bytedance.py:1978

            f"--duration {duration} "
            f"--seed {seed} "
            f"--watermark {str(watermark).lower()}"
        )
        x = [
            TaskTextContent(text=prompt),
            *[TaskImageContent(image_url=TaskImageContentUrl(url=str(i)), role="reference_image") for i in image_urls],
        ]
        return await process_video_task(
            cls,
            payload=Image2VideoTaskCreationRequest(model=model, content=x, generate_audio=None),
            estimated_duration=max(1, math.ceil(VIDEO_TASKS_EXECUTION_TIME[model][resolution] * (duration / 10.0))),
        )


def raise_if_text_params(prompt: str, text_params: list[str]) -> None:
    for i in text_params:
        if f"--{i} " in prompt:
            raise ValueError(
                f"--{i} is not allowed in the prompt, use the appropriated widget input to change this value."
            )


PRICE_BADGE_VIDEO = IO.PriceBadge(
    depends_on=IO.PriceBadgeDepends(widgets=["model", "duration", "resolution", "generate_audio"]),
    expr="""
    (
      $priceByModel := {
        "seedance-1-5-pro": {
          "480p":[0.12,0.12],
          "720p":[0.26,0.26],
          "1080p":[0.58,0.59]
        },
        "seedance-1-0-pro": {
          "480p":[0.23,0.24],
          "720p":[0.51,0.56],
          "1080p":[1.18,1.22]

View on GitHub (pinned to 1c6d8d45b3)

Solutions

  1. Remove inline flags from the prompt and set the values in the node's widgets (resolution, aspect_ratio, duration, seed, camera_fixed, watermark).
  2. If the literal text is stylistically needed, avoid the exact '--flag ' pattern (no trailing space) — but the intended fix is using widgets.
  3. Sanitize external prompts programmatically before feeding the node.

Example fix

# before
prompt = "a drone shot of a city --resolution 720p --duration 5"
# -> raises on '--resolution '

# after
prompt = "a drone shot of a city"
# set resolution='720p', duration=5 in the node widgets
Defensive patterns

Strategy: validation

Validate before calling

import re
TEXT_PARAMS = ['resolution', 'ratio', 'duration', 'seed', 'camerafixed', 'watermark']
def sanitize_prompt(prompt: str) -> str:
    return re.sub(r'--(?:' + '|'.join(TEXT_PARAMS) + r')\s+\S+', '', prompt).strip()

Prevention

When it happens

Trigger: A prompt literally containing e.g. '--resolution 720p ', '--ratio 16:9 ', '--duration 5 ', '--seed 123 ', '--camerafixed true ' or '--watermark false ' (trailing space required by the ' f"--{i} "' check) on any Seedance text/image/first-last video node.

Common situations: Copying prompts from BytePlus/Volcano Engine docs or other tools where Seedance is driven by inline flags; prompt templates reused from Dannadori/other frontends that embed Seedance parameters in text.

Related errors


AI-assisted analysis of Comfy-Org/ComfyUI@1c6d8d45b3 (2026-08-14). Data as JSON: /api/errors/b34f85081d9f5a6b. Report an issue: GitHub.