Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[bug]: upload_image resize_to is documented as a stringified tuple, but only a JSON object with width and height is accepted

Aperta Adatta ai principianti
#10,047 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@GuilhermeAAV ci sta già lavorando.

Dal 27/10/2026.

Valutazione

Difficoltà
1/5
Tempo stimato
Meno di un'ora
Idoneità per principianti
88/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
openapi, python
Ambito
api

Direzione di ricerca

Leggi la descrizione e l’esempio di resize_to in invokeai/app/api/routers/images.py, intorno alle righe 124–128, poi confrontali con il codice di parsing alle righe 157–162 e con ResizeToDimensions alle righe 74–76. Aggiorna il testo dello schema e l’esempio in modo che corrispondano all’oggetto JSON accettato, con width e height interi. Il lavoro è completo quando la descrizione e l’esempio pubblicati in OpenAPI corrispondono al formato accettato dall’endpoint.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Is there an existing issue for this problem?
  • I have searched the existing issues
Install method

Manual

Operating system

macOS

GPU vendor

Apple Silicon (MPS)

GPU model

No response

GPU VRAM

No response

Version number

v6.14.2 (also present on main at 2a72b3c5683a2c2f0d7f66fdc32a1edce9244e54)

Browser

No response

System Information

No response

What happened

The OpenAPI description and example for the resize_to form field of POST /api/v1/images/upload don't match what the endpoint accepts.

The schema says:

Dimensions to resize the image to, must be stringified tuple of 2 integers. Max total pixel count: 16777216

with the example "[1024,1024]".

Sending a stringified tuple, as documented, fails:

curl -X POST 'http://127.0.0.1:9091/api/v1/images/upload?image_category=user&is_intermediate=true' \
  -F '[email protected];type=image/png' -F 'resize_to=[32,24]'
→ 400 {"detail":"Invalid resize_to format or size"}

The documented example itself ("[1024,1024]", with its quotes) fails the same way.

Sending a JSON object succeeds:

curl -X POST 'http://127.0.0.1:9091/api/v1/images/upload?image_category=user&is_intermediate=true' \
  -F '[email protected];type=image/png' -F 'resize_to={"width":32,"height":24}'
→ 201, and the stored image is 32×24

The endpoint parses the field as an object (invokeai/app/api/routers/images.py at v6.14.2, lines 157-162):

dims = json.loads(resize_to)
resize_dims = ResizeToDimensions(**dims)

where ResizeToDimensions has width and height fields (lines 74-76). A JSON array can't be unpacked with **, so the except Exception turns it into the 400.

The web UI already sends the object form (webv1/src/services/api/endpoints/images.ts line 838 does JSON.stringify(resize_to), typed as Dimensions in services/api/types.ts), so only the schema description and example are wrong.

What you expected to happen

The description and example to describe the format the endpoint accepts, e.g.:

description=f"Dimensions to resize the image to, as a stringified JSON object with integer width and height. Max total pixel count: {ResizeToDimensions.MAX_SIZE}",
examples=['{"width": 1024, "height": 1024}'],

(currently lines 124-128 of invokeai/app/api/routers/images.py on main).

How to reproduce the problem
  1. Start InvokeAI 6.14.2 (a fresh install with an in-memory database is enough).
  2. Upload any PNG to POST /api/v1/images/upload with resize_to=[32,24]: 400 Invalid resize_to format or size.
  3. Repeat with resize_to={"width":32,"height":24}: 201, resized as requested.
Additional context

Also reproduced on a Linux / ROCm 6.14.2 instance. API clients that follow the published schema can't use this field; the UI is unaffected.

Discord username

No response

Lingua principale
TypeScript
Stelle
28.8k
Fork
3.1k
Merge medio
3g 10h
PR unite (30g)
175

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di invoke-ai/InvokeAI

Tutte le issue di invoke-ai/InvokeAI

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.