invoke-ai/InvokeAI · warning · HTTPException

No images or board id specified.

Error message

No images or board id specified.

What it means

HTTP 400 raised by POST /images/download when the request body contains neither a non-empty image_names array nor a board_id. The endpoint requires at least one download target and rejects ambiguous requests before doing any work.

Source

Thrown at invokeai/app/api/routers/images.py:778

@images_router.post(
    "/download", operation_id="download_images_from_list", response_model=ImagesDownloaded, status_code=202
)
def download_images_from_list(
    current_user: CurrentUserOrDefault,
    background_tasks: BackgroundTasks,
    image_names: Optional[list[ImageName]] = Body(
        default=None,
        description="The list of names of images to download",
        embed=True,
        max_length=MAX_IMAGE_BATCH_SIZE,
    ),
    board_id: Optional[str] = Body(
        default=None, description="The board from which image should be downloaded", embed=True
    ),
) -> ImagesDownloaded:
    if (image_names is None or len(image_names) == 0) and board_id is None:
        raise HTTPException(status_code=400, detail="No images or board id specified.")

    # Validate that the caller can read every image they are requesting.
    # For a board_id request, check board visibility; for explicit image names,
    # check each image individually.
    if board_id:
        _assert_board_read_access(board_id, current_user)
    if image_names:
        for name in image_names:
            _assert_image_read_access(name, current_user)

    assert_image_move_maintenance_inactive()

    bulk_download_item_id: str = ApiDependencies.invoker.services.bulk_download.generate_item_id(board_id)

    background_tasks.add_task(
        ApiDependencies.invoker.services.bulk_download.handler,
        image_names,
        board_id,

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Include at least one image_name in image_names
  2. Or pass a valid board_id to download the whole board
  3. Fix client logic to disable the download action when selection and board are both empty

Example fix

// before
api.post('/images/download', { image_names: selected });
// after
if (selected.length === 0 && !boardId) return;
api.post('/images/download', selected.length ? { image_names: selected } : { board_id: boardId });
Defensive patterns

Strategy: validation

Validate before calling

function canRequestDownload(names, boardId) {
  return (Array.isArray(names) && names.length > 0) || (typeof boardId === 'string' && boardId.length > 0);
}
if (!canRequestDownload(imageNames, boardId)) return; // skip API call

Type guard

function hasDownloadTarget(names, boardId): boolean {
  return (Array.isArray(names) && names.length > 0) || typeof boardId === 'string';
}

Try / catch

try {
  await api.downloadImagesFromList(imageNames, boardId);
} catch (e) {
  if (e instanceof ApiError && e.status === 400) {
    // show 'select images or a board first' in the UI
  }
}

Prevention

When it happens

Trigger: POST /api/v1/images/download with body {image_names: [], board_id: null}, or image_names omitted entirely, or an empty array with no board_id.

Common situations: UI state lost so selection was empty when download was clicked; client builds the body conditionally and sends neither field; a filter produced zero selected images.

Understand the failure class

Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.

Related errors


AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29). Data as JSON: /api/errors/0875b06fc6f528cc. Report an issue: GitHub.