[bug]: upload_image resize_to is documented as a stringified tuple, but only a JSON object with width and height is accepted
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
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
- Start InvokeAI 6.14.2 (a fresh install with an in-memory database is enough).
- Upload any PNG to
POST /api/v1/images/uploadwithresize_to=[32,24]: 400Invalid resize_to format or size. - 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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di invoke-ai/InvokeAI
-
[bug]: Anima kohya LoRAs: layers outside the DiT blocks are not appliedForse già presa @guishiw l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
invoke-ai/InvokeAI#10028 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
[bug]: FLUX.1 diffusers-format LoRAs with text-encoder layers fail to loadForse già presa @chiliec l’ha presa 1 giorno fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
invoke-ai/InvokeAI#10024 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
[bug]: FLUX final-layer modulation LoRA layer is not converted (FLUX.1 diffusers: load fails, FLUX.2 BFL: layer skipped)Forse già presa @Pfannkuchensack l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
invoke-ai/InvokeAI#10022 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
[enhancement]: Bump PyPatchMatch to latestForse già presa @dunkeroni l’ha presa 13 giorni fa. Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
invoke-ai/InvokeAI#9826 · 2 reazioni · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 62/100
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di invoke-ai/InvokeAI
Issue simili
-
[Bug]: Pen taps on sidebar rows start a drag and lose their clickForse già presa @makhnatkin l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
b310-digital/teammapper#1515 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
puckeditor/puck#1884 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
outline/outline#14378 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
nicobailon/pi-web-access#642 ·
I maintainer di solito rispondono entro 1 giorno