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

[ImageMask] - Brush missing #10236

Open
1 task done
elismasilva opened this issue Dec 21, 2024 · 2 comments
Open
1 task done

[ImageMask] - Brush missing #10236

elismasilva opened this issue Dec 21, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@elismasilva
Copy link

elismasilva commented Dec 21, 2024

Describe the bug

I don't know what I'm doing wrong, or if it's a bug, but I'm trying to use the brushes to draw the mask as is done in this example:
https://huggingface.co/spaces/OzzyGT/diffusers-image-fill

But when I load exactly the same code it doesn't work.
In this docs https://www.gradio.app/docs/gradio/imageeditor#demos i tried upload image here but has same problem.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr
with gr.Blocks() as app:   
    imageMask = gr.ImageMask(
            type="pil",
            label="Input Image",
            crop_size=(1024, 1024),
            canvas_size=(1024, 1024),
            layers=False,
            sources=["upload"],
            interactive=True
        )

app.launch(inbrowser=True)

Screenshot

image

Logs

N/A

System Info

Gradio Environment Information:
------------------------------
Operating System: Windows
gradio version: 5.9.1
gradio_client version: 1.5.2

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

aiofiles: 23.2.1
anyio: 4.4.0
audioop-lts is not installed.
fastapi: 0.115.4
ffmpy: 0.4.0
gradio-client==1.5.2 is not installed.
httpx: 0.27.0
huggingface-hub: 0.25.2
jinja2: 3.1.3
markupsafe: 2.1.5
numpy: 1.26.3
orjson: 3.10.6
packaging: 24.1
pandas: 2.2.2
pillow: 11.0.0
pydantic: 2.8.2
pydub: 0.25.1
python-multipart: 0.0.19
pyyaml: 6.0.1
ruff: 0.5.6
safehttpx: 0.1.6
semantic-version: 2.10.0
starlette: 0.41.2
tomlkit: 0.12.0
typer: 0.12.3
typing-extensions: 4.12.2
urllib3: 2.2.2
uvicorn: 0.30.5
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.


gradio_client dependencies in your environment:

fsspec: 2024.2.0
httpx: 0.27.0
huggingface-hub: 0.25.2
packaging: 24.1
typing-extensions: 4.12.2
websockets: 12.0

Severity

Blocking usage of gradio

@elismasilva elismasilva added the bug Something isn't working label Dec 21, 2024
@elismasilva
Copy link
Author

After doing some more tests, I noticed that if I set the height to something like 1000, for example, I can see the buttons. But I think the correct behavior of the component would be to allow me to define the width and height so that it fits in the interface at the size I want, and when uploading the image to the component, even if it is larger than the component's measurements, it is adjusted to fit visibly inside the component, considering the space needed for the buttons below. This resizing would only be visual, not changing the real resolution of the image or the applied mask. I tested ImageMask, ImageEditor, Sketchpad, they all have the same problem.

@elismasilva
Copy link
Author

Since we're talking about this component, if you could answer me, when I tested this ImageEditor component in version 4.44 it ran extremely slow, I couldn't even draw the mask because it would freeze.
I haven't been able to compare its speed in version 5 yet. But this application here at this link https://huggingface.co/spaces/diffusers/stable-diffusion-xl-inpainting uses an older version of Gradio and runs extremely well, without lag. If you could guarantee that in version 5 it would run like this, it would be perfect.

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

No branches or pull requests

1 participant