-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Refactor and redesign ImageEditor
component
#10635
base: main
Are you sure you want to change the base?
Conversation
Anyway you can do two things:
You cannot do both. My main question is the interplay between crop and resize. Should crop refocus on the resized image? It probably should since it is an image crop.
|
The python API won't do anything and I don't expect it to work with gradio right now, just dealing with finalising the UI work. |
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-pypi-previews.s3.amazonaws.com/16c2f8d4a041d382b40c2a0001c01bc066ebfb0b/gradio-5.20.1-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@16c2f8d4a041d382b40c2a0001c01bc066ebfb0b#subdirectory=client/python" Install Gradio JS Client from this PR npm install https://gradio-npm-previews.s3.amazonaws.com/16c2f8d4a041d382b40c2a0001c01bc066ebfb0b/gradio-client-1.13.1.tgz Use Lite from this PR <script type="module" src="https://gradio-lite-previews.s3.amazonaws.com/16c2f8d4a041d382b40c2a0001c01bc066ebfb0b/dist/lite.js""></script> |
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
|
@pngwn I wasn't able to do a lot of testing since the image upload and drawing features are the broken state, even separately for me: ![]()
I agree, and just to confirm, cropping can be undo-ed?
I'm not sure which menu UIs we are referring to? Can you elaborate or share a screenshot? |
Ah, that is slightly more broken than intended but I see the issue locally too. I'll repost with more clarity shortly. |
@hannahblair I will consider your request. Jk, yeah I'll change that! |
Very very cool @pngwn! Just going through and testing, I noticed a few things:
Screen.Recording.2025-03-07.at.1.56.11.PM.mov
![]()
![]() The alt text says maximize but it seems to have no effect. If it's really maximizing the input image, then I suggest moving it to the zoom toolbar.
![]()
Actually interestingly, after you upload an image right now, the tool doesn't change, but you have the ability to draw on the uploaded image. However, this drawing is very jerky and buggy. Only when you actually click on the draw tool can you draw reliably, see this: Screen.Recording.2025-03-07.at.2.18.24.PM.mov(still testing...) |
Love the erasing UX! Screen.Recording.2025-03-07.at.2.28.23.PM.mov |
(5) The cropping and resizing don't apply to the annotations. Is that expected? I would have expected everything to be cropped/resized: Screen.Recording.2025-03-07.at.2.39.44.PM.mov(you'll also notice a flaky behavior the first time the cropping tool was used). The code here is just: import gradio as gr
with gr.Blocks() as demo:
with gr.Row():
ie = gr.ImageEditor()
io = gr.Image()
b = gr.Button()
b.click(lambda x: x["composite"], ie, io)
demo.launch() |
The zooming works great, exactly as expected |
Heroic work @pngwn ! Works great. Noticed some small issues. Apologies if they are repeats/made obsolete by @hannahblair 's upcoming UI enhancements
![]()
![]()
![]()
|
js/upload/src/Upload.svelte
Outdated
@@ -230,6 +230,19 @@ | |||
: height | |||
: "100%"} | |||
tabindex={hidden ? -1 : 0} | |||
on:drag|preventDefault|stopPropagation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pngwn can you check that i resolved this merge conflict correctly
### Description This pull request updates the `get_node_path` function in the `gradio/utils.py` file to handle scenarios where the `which` command is missing. The function has been improved by splitting the error handling into two separate `try` blocks for better granularity and robustness. ### Changes Made - Split the `try` block into two separate `try` blocks for handling Windows and Unix-like systems. - Added error handling for `FileNotFoundError` in addition to `subprocess.CalledProcessError`. ### Rationale The original implementation did not properly handle the case when the `which` command is missing. This update ensures the function gracefully handles such scenarios and continues to check other possible locations for the `node` executable.
* fix: latex rendering of markdown * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Dawood Khan <dawoodkhan82@gmail.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
* tweak layers ui * upload alignment and text colour * change check icon * zoom tweaks * tweak layers panel
This is a not working draft of the image editor. I had it half working until i let o3 run wild and then i broke everything.
o3 has done more to set this country back than Margaret Thatcher.