Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layers Of The ImageEditor/ImageMask Input Is Always An Empty List #10298

Closed
1 task done
CyberVy opened this issue Jan 7, 2025 · 2 comments · Fixed by #10306
Closed
1 task done

Layers Of The ImageEditor/ImageMask Input Is Always An Empty List #10298

CyberVy opened this issue Jan 7, 2025 · 2 comments · Fixed by #10306
Assignees
Labels
bug Something isn't working

Comments

@CyberVy
Copy link

CyberVy commented Jan 7, 2025

Describe the bug

As far as I know there are several bugs in ImageMask and ImageEditor.

  • When using ImageMask and ImageEditor as an input in the latest version, the layers of the dict is always an empty list.
  • The layers are still be displayed on the component after removing the image when using ImageMask and ImageEditor. This is a bug in the latest version too.
  • By the way, what I've input is an 1024 * 1024 image, but what I got is a 675 * 675 image. It's an existed bug in ImageEditor Generates The Unexpected Size Image #10265.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr


def f(image):
    print(image)
    return image

with gr.Blocks() as server:
    inputs = [gr.ImageMask(type="pil")]
    outputs = [gr.Textbox()]
    btn = gr.Button()
    btn.click(fn=f,inputs=inputs,outputs=outputs)

server.launch()

Screenshot

The layers are still be displayed on the component after removing the image.
-

Logs

After uploading and editing an image, I got the output below.

{'background': <PIL.Image.Image image mode=RGBA size=675x675 at 0x11C465590>, 'layers': [], 'composite': <PIL.Image.Image image mode=RGBA size=675x675 at 0x11C883360>}
System Info
Gradio Environment Information:
------------------------------
Operating System: Darwin
gradio version: 5.10.0
gradio_client version: 1.5.3

------------------------------------------------
gradio dependencies in your environment:

aiofiles: 23.2.1
anyio: 4.7.0
audioop-lts: 0.2.1
fastapi: 0.115.6
ffmpy: 0.4.0
gradio-client==1.5.3 is not installed.
httpx: 0.28.1
huggingface-hub: 0.27.0
jinja2: 3.1.4
markupsafe: 2.1.5
numpy: 2.2.0
orjson: 3.10.12
packaging: 24.2
pandas: 2.2.3
pillow: 11.0.0
pydantic: 2.10.3
pydub: 0.25.1
python-multipart: 0.0.20
pyyaml: 6.0.2
ruff: 0.8.3
safehttpx: 0.1.6
semantic-version: 2.10.0
starlette: 0.41.3
tomlkit: 0.13.2
typer: 0.15.1
typing-extensions: 4.12.2
urllib3: 2.2.3
uvicorn: 0.34.0
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.


gradio_client dependencies in your environment:

fsspec: 2024.10.0
httpx: 0.28.1
huggingface-hub: 0.27.0
packaging: 24.2
typing-extensions: 4.12.2
websockets: 14.1

Severity

Blocking usage of gradio

@CyberVy CyberVy added the bug Something isn't working label Jan 7, 2025
@CyberVy
Copy link
Author

CyberVy commented Jan 7, 2025

@abidlabs Please have a look, thank you. :)

@CyberVy
Copy link
Author

CyberVy commented Jan 7, 2025

I think it's a bug of ImageEditor inherited by ImageMask, because when I run the code below, I got the same results.

import gradio as gr


def f(image):
    print(image)
    return image

with gr.Blocks() as server:
    inputs = [gr.ImageEditor(type="pil")]
    outputs = [gr.Textbox()]
    btn = gr.Button()
    btn.click(fn=f,inputs=inputs,outputs=outputs)

server.launch()

After uploading and editing an image, I got the output below.

 {'background': <PIL.Image.Image image mode=RGBA size=675x675 at 0x115F2BD90>, 'layers': [], 'composite': <PIL.Image.Image image mode=RGBA size=675x675 at 0x116352D70>}

@CyberVy CyberVy changed the title Layers Of The ImageMask Input Is Always An Empty List Layers Of The ImageEditor/ImageMask Input Is Always An Empty List Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants