CherryHQ/cherry-studio · error · Error

Image generation for

Error message

Image generation for '${sdkConfig.modelId}' completed but returned no image URLs

What it means

Error "Image generation for '${sdkConfig.modelId}' completed but returned no image URLs" thrown in CherryHQ/cherry-studio.

Solutions

  1. Inspect the raw provider response to see which field carries the generated images and update the transport parser accordingly.
  2. Retry the request; some providers intermittently return empty result sets under load.
  3. Check the provider dashboard for content-filter rejections that yield a success status with no URLs.

Example fix

Map the provider's result field correctly, e.g. imageUrls: data.output.results.map(r => r.url), instead of assuming data.images.

When it happens

Trigger: The provider invocation completes successfully but yields an empty image URL list — either submit.imageUrls === [] or poll() resolves with [].

Common situations: Typical when content moderation blocks the generation or the vendor returns a degraded success response while still charging. The handler records the invocation with imageCount=0, then fails the job rather than reporting a silent zero-image success.


AI-assisted analysis of CherryHQ/cherry-studio@726446b54c (2026-08-12). Data as JSON: /api/errors/c0ba4385f3cfe896. Report an issue: GitHub.

Appendix: source

Thrown at src/main/ai/provider/custom/tasks/imageGenerationJobHandler.ts:132

    if (captureContext) {
      const completedAt = Date.now()
      aiUsageRecordService.recordInvocation({
        requestId: `custom-image:${ctx.jobId}`,
        context: captureContext,
        modality: 'image',
        imageCount: urls.length,
        metrics: { timeCompletionMs: Math.max(0, completedAt - usageStartedAt) },
        completedAt
      })
    }

    // An empty URL list from a *successful* submit/poll (e.g. content moderation
    // or a degraded vendor response that still charged) must fail rather than
    // complete as a silent zero-image "success". Covers both submit.imageUrls === []
    // and poll() === []; the malformed-submit (neither field) case threw above.
    // Recorded above with imageCount=0 because the provider invocation did complete.
    if (urls.length === 0) {
      throw new Error(`Image generation for '${sdkConfig.modelId}' completed but returned no image URLs`)
    }

    const files = await downloadAndPersistImageUrls(urls, ctx.signal, input.cleanupPolicy)
    ctx.reportProgress(100, { stage: 'done' })
    return { files } satisfies ImageGenerationJobOutput
  }
}

async function buildSubmitInput(
  input: ImageGenerationJobPayload,
  modelId: string,
  signal: AbortSignal
): Promise<ImageGenerationSubmitInput> {
  const files = input.inputFileIds?.length ? await Promise.all(input.inputFileIds.map(readImageFile)) : undefined
  const mask = input.maskFileId ? await readImageFile(input.maskFileId) : undefined
  return {
    modelId,
    prompt: input.prompt,

View on GitHub (pinned to 726446b54c)