calesthio/OpenMontage · error · RuntimeError

Seedream completed but no images returned

Error message

Seedream completed but no images returned

What it means

Raised when the Seedream request reached COMPLETED and the result JSON was fetched, but result_data['images'] is missing or an empty list. The queue considers the task done yet delivered no image payloads, so there is nothing to download. Indicates a malformed completion or an API response-shape change (e.g. images moved under another key).

Source

Thrown at tools/graphics/seedream_image.py:237

                elapsed += 10

            if elapsed >= 300:
                raise RuntimeError(
                    f"Seedream task timed out after {300}s"
                )

            result_resp = requests.get(
                f"https://queue.fal.run/bytedance/seedream/requests/"
                f"{request_id}",
                headers=headers,
                timeout=30,
            )
            result_resp.raise_for_status()
            result_data = result_resp.json()

            images = result_data.get("images", [])
            if not images:
                raise RuntimeError("Seedream completed but no images returned")

            ext = inputs.get("output_format", "jpeg")
            expected_paths = self._output_paths(
                inputs.get("output_path"), len(images), ext
            )
            output_paths = []
            for img, output_path in zip(images, expected_paths):
                image_url = img.get("url")
                if not image_url:
                    continue
                image_resp = requests.get(image_url, timeout=60)
                image_resp.raise_for_status()

                output_path.parent.mkdir(parents=True, exist_ok=True)
                output_path.write_bytes(image_resp.content)
                output_paths.append(str(output_path))

        except Exception as e:

View on GitHub (pinned to 95e1c3d0ab)

Solutions

  1. Log result_data keys — if images live under another key, update the extraction line
  2. Retry once: empty completions are occasionally transient
  3. Report/verify against current fal.run queue result docs if the shape changed

Example fix

// before
images = result_data.get("images", [])
// after
images = (
    result_data.get("images")
    or (result_data.get("output") or {}).get("images")
    or (result_data.get("data") or {}).get("images")
    or []
)
Defensive patterns

Strategy: try-catch

Validate before calling

null

Try / catch

try:
    paths = seedream_run(inputs)
except RuntimeError as e:
    if "no images returned" in str(e):
        logger.error("seedream empty completion; raw result needed")
        return seedream_run(inputs)  # retry once; often transient
    raise

Prevention

When it happens

Trigger: Result endpoint returns {'status':'COMPLETED'} with images under 'output.images' or 'data.images' instead of top-level 'images'; upstream finished but produced zero images (empty response body normalized to []).

Common situations: fal.run result schema drift; a gateway stripping fields; rare upstream empty-completion bugs.

Related errors


AI-assisted analysis of calesthio/OpenMontage@95e1c3d0ab (2026-08-15). Data as JSON: /api/errors/4d4c5a92f1e611a0. Report an issue: GitHub.