invoke-ai/InvokeAI · error · ExternalProviderRequestError
DashScope async response contained no images: {output}
Error message
DashScope async response contained no images: {output} What it means
The async task reported SUCCEEDED and 'results' was a list, but iterating it produced zero downloadable images: every entry either wasn't a dict, or lacked both a usable 'url' string and 'b64_image' string. The provider raises ExternalProviderRequestError with the output payload.
Source
Thrown at invokeai/app/services/external_generation/providers/alibabacloud.py:281
if not isinstance(results, list):
raise ExternalProviderRequestError(f"DashScope async response missing results: {output}")
images: list[ExternalGeneratedImage] = []
for result in results:
if not isinstance(result, dict):
continue
url = result.get("url")
if isinstance(url, str) and url:
pil_image = self._download_image(url)
images.append(ExternalGeneratedImage(image=pil_image, seed=request.seed))
continue
b64_image = result.get("b64_image")
if isinstance(b64_image, str) and b64_image:
pil_image = decode_image_base64(b64_image)
images.append(ExternalGeneratedImage(image=pil_image, seed=request.seed))
if not images:
raise ExternalProviderRequestError(f"DashScope async response contained no images: {output}")
return ExternalGenerationResult(
images=images,
seed_used=request.seed,
provider_request_id=request_id,
provider_metadata={"model": request.model.provider_model_id},
)
def _download_image(self, url: str) -> PILImageType:
"""Download an image from a URL and return it as a PIL Image, with a size cap."""
try:
response = requests.get(url, timeout=_DOWNLOAD_TIMEOUT, stream=True)
except requests.RequestException as exc:
raise ExternalProviderRequestError(f"Failed to download image from DashScope: {exc}") from exc
with response:
if not response.ok:
raise ExternalProviderRequestError(View on GitHub (pinned to 0b6a024f2f)
Solutions
- Inspect the embedded output to see the actual keys in each result entry
- If results are empty [], retry the generation — the task 'succeeded' without producing images
- Extend/patch _parse_async_response to read alternate keys (e.g. 'image_url', nested 'code') for your custom model
- Switch the model to _SYNC_MODELS if it actually supports the synchronous multimodal API
- Verify the DashScope region/API version matches the documented async image-generation schema
Example fix
// before
url = result.get("url")
if isinstance(url, str) and url:
...
// after
url = result.get("url") or result.get("image_url") or result.get("code")
if isinstance(url, str) and url.startswith("http"):
... Defensive patterns
Strategy: validation
Validate before calling
def results_look_valid(output: dict) -> bool:
results = output.get("results")
return isinstance(results, list) and any(
isinstance(r, dict) and (r.get("url") or r.get("b64_image")) for r in results
) Type guard
def result_has_image(result: dict) -> bool:
return isinstance(result, dict) and (
isinstance(result.get("url"), str) and bool(result["url"])
or isinstance(result.get("b64_image"), str) and bool(result["b64_image"])
) Try / catch
try:
result = provider.generate(request)
except ExternalProviderRequestError as e:
if "contained no images" in str(e):
log.warning("Async task produced zero images; retrying once")
result = provider.generate(request)
else:
raise Prevention
- Retry the generation when a SUCCEEDED task yields empty results
- Inspect the result entry keys for custom models and patch the parser accordingly
- Confirm the model's documented result schema (url vs b64_image vs code)
- Test custom models end-to-end before production use
When it happens
Trigger: results entries use a different URL key (e.g. 'image_url' or 'code' with a merged URL); results contain error objects; DashScope returned success with empty results [].
Common situations: Custom async models with a result schema unlike wan/wuye image APIs; DashScope partial success returning empty results; region/API revision where result URLs are nested under 'code' instead of 'url'.
Related errors
- DashScope async response missing results: {output}
- DashScope response missing output: {data}
- DashScope response missing choices: {data}
- DashScope response contained no images: {data}
- Alibaba Cloud DashScope API key is not configured
AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29).
Data as JSON: /api/errors/36c59a4a4a2d13ba.
Report an issue: GitHub.