# Gradio problem, gradio change not functioning good for gr.Image

**URL:** <https://discuss.huggingface.co/t/gradio-problem-gradio-change-not-functioning-good-for-gr-image/149081>\
**Category:** Beginners\
**Created:** [April 6, 2025, 7:18am UTC](https://discuss.huggingface.co/t/gradio-problem-gradio-change-not-functioning-good-for-gr-image/149081 "2025-04-06T07:18:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ironly3000](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/ironly3000/32/42120_2.png) [@ironly3000](https://discuss.huggingface.co/u/ironly3000)\
**Post date:** [April 6, 2025, 7:18am UTC](https://discuss.huggingface.co/t/gradio-problem-gradio-change-not-functioning-good-for-gr-image/149081/1 "2025-04-06T07:18:22Z")

</div>

## ❗ FastAPI / Gradio Error: `TypeError: argument of type 'bool' is not iterable`

I’m running into an error when using **Gradio** (wrapped in **FastAPI** , served with **uvicorn** ). When a frontend interaction is triggered, I get the following traceback (excerpt):

```auto
TypeError: argument of type 'bool' is not iterable
File "gradio_client\utils.py", line 898, in get_type
  if "const" in schema:

```

### 🔍 Context:

Here’s the code that causes the error:

```python
im_display.change(fn=update_image, inputs=[im_display], outputs=[s3image])

```

- `im_display` is a `gr.Image()`
- `s3image` is also a `gr.Image()`
- The function `update_image` returns `gr.update(...)`

⚠ If I change the output to a `gr.Textbox()`, like this:

```python
im_display.change(fn=update_image, inputs=[im_display], outputs=[gr.Textbox()])

```

Then the error **does not** happen. So the issue seems to be related to using `gr.Image` as the output.

### 🔁 Additional Info:

- The error still happens no matter what arguments I pass to `gr.update()`, e.g., `value=...`, `visible=True`, etc.
- Everything works fine when returning updates to a `Textbox`.

* * *

### ❓ Question:

Has anyone else run into this issue when returning `gr.update()` to a `gr.Image()` output?  
Is there a workaround or fix for this schema parsing issue?

My environment:

- Windows / Conda
- Python 3.x
- Gradio installed via pip (5.20)

Any help is appreciated! I can provide a minimal reproducible example if needed.

---

<div class="post-metadata">

**Author:** ![John6666](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/john6666/32/27664_2.png) [@John6666](https://discuss.huggingface.co/u/John6666)\
**Post date:** [April 6, 2025, 10:17am UTC](https://discuss.huggingface.co/t/gradio-problem-gradio-change-not-functioning-good-for-gr-image/149081/2 "2025-04-06T10:17:00Z")

</div>

> TypeError: argument of type ‘bool’ is not iterable  
> File “gradio\_client\utils.py”, line 898, in get\_type  
> if “const” in schema:

The conditions and components are completely different, but the error content is exactly the same, so it might be the same cause…

> [@Error : No API Found](https://discuss.huggingface.co/t/error-no-api-found/146226):
>
> Hi, I have built a Gemini 2.0 flash based photo editing app with gradio ui. This app is running perfectly fine on my local system, but when I am trying to run it on spaces it is giving me Error : No API Found. I have used gemini api keys in secrects Code : [https://huggingface.co/spaces/Saurabh502/Gemini-photo/resolve/main/app.py](https://huggingface.co/spaces/Saurabh502/Gemini-photo/resolve/main/app.py) Please let me know your thoughts, on how to resolve this. Thanks

```auto
pydantic==2.10.6

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/hellohellohello/original/2X/d/de4155eb4aa4108ecb32a1389d7cc37ae69f88b7.png) [@system](https://discuss.huggingface.co/u/system)\
**Post date:** [April 7, 2025, 10:21am UTC](https://discuss.huggingface.co/t/gradio-problem-gradio-change-not-functioning-good-for-gr-image/149081/3 "2025-04-07T10:21:06Z")

</div>

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.
