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

[Gradio 5] - Gallery with two "X" close button #9956

Open
1 task done
elismasilva opened this issue Nov 13, 2024 · 9 comments · May be fixed by #10016
Open
1 task done

[Gradio 5] - Gallery with two "X" close button #9956

elismasilva opened this issue Nov 13, 2024 · 9 comments · May be fixed by #10016
Labels
bug Something isn't working

Comments

@elismasilva
Copy link

Describe the bug

I have noticed that the gallery in the latest version of Gradio is showing 2 buttons to close the gallery image, and the button on top is interfering with the selection of the buttons below. This happens when I am in preview mode, either starting in preview mode or after clicking on the image to preview.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr
with gr.Blocks(analytics_enabled=False) as app:   
    gallery = gr.Gallery(label="Generated Images",  interactive=True, show_label=True, preview=True, allow_preview=True)

app.launch(inbrowser=True)

Screenshot

image

Logs

N/A

System Info

Gradio Environment Information:
------------------------------
Operating System: Windows
gradio version: 5.5.0
gradio_client version: 1.4.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.4.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: 10.2.0
pydantic: 2.8.2
pydub: 0.25.1
python-multipart==0.0.12 is not installed.
pyyaml: 6.0.1
ruff: 0.5.6
safehttpx: 0.1.1
semantic-version: 2.10.0
starlette: 0.41.2
tomlkit==0.12.0 is not installed.
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

I can work around it

@elismasilva elismasilva added the bug Something isn't working label Nov 13, 2024
@freddyaboulton
Copy link
Collaborator

This has been fixed on main @elismasilva !

@freddyaboulton
Copy link
Collaborator

image

@elismasilva
Copy link
Author

@freddyaboulton ok i wait for next release because if i install from main i need do contribution guide steps, has any way to install from main and run like is installed from pip? i getting error "ValueError: Did you install Gradio from source files? You need to build the frontend by running /scripts/build_frontend.sh" but i already run this script, so i will not wast time with this, this is a little bug.

@freddyaboulton
Copy link
Collaborator

@elismasilva - you can go to the Chore: Update Versions PR and scroll to the Install Gradio from this PR comment. It has a link to a built wheel corresponding to the latest changes in the main branch. Right now it is:

pip install https://gradio-pypi-previews.s3.amazonaws.com/540dc498700aae5ef3adb943e3ebdaf0c97edc7c/gradio-5.5.0-py3-none-any.whl

@elismasilva
Copy link
Author

elismasilva commented Nov 15, 2024

@elismasilva - you can go to the Chore: Update Versions PR and scroll to the Install Gradio from this PR comment. It has a link to a built wheel corresponding to the latest changes in the main branch. Right now it is:

pip install https://gradio-pypi-previews.s3.amazonaws.com/540dc498700aae5ef3adb943e3ebdaf0c97edc7c/gradio-5.5.0-py3-none-any.whl

hi @freddyaboulton , ive installed from this PR gradio client and gradio app, but the issue persists. Ive uninstalled previous versios, re-created new venv and have this:

image

and if i close image on "X" behind, the image remain aligned to the right, not centered:
image

@elismasilva
Copy link
Author

elismasilva commented Nov 18, 2024

@abidlabs @freddyaboulton is it necessary to open this bug again, I installed gradio 5.6.0 and the bug is present, or do I need to open a new bug again?

@abidlabs abidlabs reopened this Nov 18, 2024
@freddyaboulton
Copy link
Collaborator

@elismasilva - can you share a full reproducer? I can't reproduce on spaces: https://huggingface.co/spaces/gradio/fake_gan

@elismasilva
Copy link
Author

elismasilva commented Nov 18, 2024

@elismasilva - can you share a full reproducer? I can't reproduce on spaces: https://huggingface.co/spaces/gradio/fake_gan

Hi @freddyaboulton, I discovered that the problem only occurs if I use the gallery in interactive mode when it is used as an Image component allowing you to upload an image it seems that the behavior of the two components merge and generate this conflict. See in my space I enabled the option for you to be able to specify an image for the gallery, if you specify an image or click on the generated images the additional "X" will appear.

https://huggingface.co/spaces/elismasilva/fake_gan

in my reproduction code provided here in this issue you can se the problem too.

Normally people wouldn't use the gallery for this purpose, but in my scenario I use it because I can reuse the interface for both purposes since I expect the user to be able to upload an existing image to the gallery to see the image's metadata.

@freddyaboulton
Copy link
Collaborator

Thank you for the detailed response and reproducer @elismasilva !

@freddyaboulton freddyaboulton linked a pull request Nov 22, 2024 that will close this issue
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.

3 participants