{"record":{"id":"b6059894f33ff88b","repo":"ATH-MaaS/Pixelle-Video","slug":"api-image-generation-returned-no-result-provider","errorCode":null,"errorMessage":"API image generation returned no result: provider={provider}, model={model}","messagePattern":"API image generation returned no result: provider=(.+?), model=(.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"pixelle_video/services/api_media.py","lineNumber":501,"sourceCode":"        save_dir = self._save_dir(output_path, \"api_images\")\n        ratio = self._ratio(width, height)\n        resolution = self._resolution(width, height)\n        session_id = params.get(\"session_id\") or \"pixelle\"\n\n        logger.info(f\"Generating image via API provider={provider}, model={model}\")\n        paths = await asyncio.to_thread(\n            client.generate_image,\n            prompt=prompt,\n            image_paths=image_paths,\n            model=model,\n            save_dir=save_dir,\n            session_id=session_id,\n            video_ratio=ratio,\n            resolution=resolution,\n        )\n\n        if not paths:\n            raise RuntimeError(f\"API image generation returned no result: provider={provider}, model={model}\")\n\n        result_path = paths[0]\n        if output_path and os.path.exists(result_path) and os.path.abspath(result_path) != os.path.abspath(output_path):\n            os.makedirs(os.path.dirname(output_path), exist_ok=True)\n            os.replace(result_path, output_path)\n            result_path = output_path\n\n        return MediaResult(media_type=\"image\", url=result_path)\n\n    async def _generate_video(\n        self,\n        provider: str,\n        model: str,\n        prompt: str,\n        image_path: Optional[str],\n        output_path: Optional[str],\n        duration: Optional[float],\n        width: Optional[int],","sourceCodeStart":483,"sourceCodeEnd":519,"githubUrl":"https://github.com/ATH-MaaS/Pixelle-Video/blob/848b054e4fae40dabc62ec58e960b573e83793ac/pixelle_video/services/api_media.py#L483-L519","documentation":"_generate_image calls the provider API and expects one or more output file paths back; when the returned paths list is empty it raises RuntimeError naming the provider and model, since image generation produced nothing.","triggerScenarios":"Provider/model returned zero output paths — generation rejected by content filter, provider error swallowed into an empty result, invalid params (ratio/resolution), or exhausted quota.","commonSituations":"Prompt flagged by the provider's safety filter; free-tier quota exhausted; unsupported resolution/ratio combination for the model; transient provider 5xx surfaced as empty result.","solutions":["Retry with the same request — transient provider failures often produce empty results","Check provider-side quota/status and any provider error logs for the request","Adjust prompt (avoid safety-filter triggers) and validate ratio/resolution against the model's supported values","Confirm the provider/model key is valid via resolve_workflow before calling"],"exampleFix":"# before\npath = await api_media.generate_image(prompt=p, workflow=wf)  # may raise empty-result\n# after\ntry:\n    path = await api_media.generate_image(prompt=p, workflow=wf)\nexcept RuntimeError:\n    path = await api_media.generate_image(prompt=p, workflow=wf)  # one retry","handlingStrategy":"retry","validationCode":"# validate workflow resolves before generating\nmeta = service.resolve_workflow(workflow)  # raises ValueError if invalid","typeGuard":null,"tryCatchPattern":"for attempt in range(3):\n    try:\n        return await api_media(prompt=prompt, workflow=workflow, media_type=\"image\")\n    except RuntimeError as e:\n        if \"returned no result\" not in str(e):\n            raise\n        await asyncio.sleep(2 ** attempt)\nraise RuntimeError(\"image generation returned no result after retries\")","preventionTips":["Retry empty generation results with exponential backoff","Sanitize prompts to avoid safety-filter rejections","Validate ratio/resolution against the model's supported values before calling","Monitor provider quota and status before batch generation"],"tags":["api","empty-response","image-generation"],"backgroundTag":"empty-api-response","analyzedSha":"848b054e4fae40dabc62ec58e960b573e83793ac","analyzedAt":"2026-08-30T03:24:41.468Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}