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

Erase Mask #102

Open
richrobber2 opened this issue Feb 2, 2024 · 3 comments
Open

Erase Mask #102

richrobber2 opened this issue Feb 2, 2024 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@richrobber2
Copy link
Owner

Description

I've encountered significant challenges attempting to customize the Gradio frontend. The main issue arises from the need to modify the frontend without direct access to the source code, compounded by the limitations imposed by Svelte's state management system.

Issue Details

Gradio's frontend, being managed with Svelte, encapsulates its state in a way that external updates through plain JavaScript are reset due to the state being internally managed. This encapsulation prevents any third-party updates from persisting, as the variables controlling the state are not exposed for importation in JavaScript files.

Additionally, my attempts to run the build_frontend.sh script to modify the source in its uncompiled state were unsuccessful. This has effectively barred me from making the necessary changes and recompiling the code into the required Svelte format.

Attempts to Resolve

  • Tried to implement changes without modifying the source directly, which proved futile due to Svelte's state management.
  • Attempted to run build_frontend.sh for source modification, without success.

Request

Given these challenges, I am reaching out for assistance in modifying and compiling the Gradio frontend source. The specific features I'm looking to integrate include Eraser for the mask, so that you can better make masks. and a button to invert the mask for ease of use. which are currently hindered by the aforementioned issues.

i can work on making the actual code if you think you can help me. i think its worth editing the source code of gradio. and since we already do it to some files i see no reason we cant do it. i can code the functionallity if you can compile it for me

@daswer123

@daswer123
Copy link
Collaborator

Hi, a long time ago I did a little tutorial on how to modify gradio sources.
here

Regarding the query, I've tried doing the erase functionality and modifying the mask in various ways before. The only normal thing I managed to do after many attempts was to make the fill functionality on X. Also after a while, I realize that continuing to modify the source code is not the best idea, although it has shown good results.

The new gradio 4.x has a large set of built-in tools for inpaint and sketch, such as erase, layers, etc. It might be worth waiting for webui to be updated to gradio 4.x

AUTOMATIC1111/stable-diffusion-webui#14184

bandicam.2024-02-02.17-54-02-339.mp4

@richrobber2
Copy link
Owner Author

richrobber2 commented Feb 2, 2024

yes i tried to modify them through the tutorial but the version number that my sd showed was not avalible. and when i tried to run the sh build it failed.

is that in the dev branch already? (nevermind i checked on my own) and do you need any help integrating anything for the new version? maybe we should make a branch for versions from the past. or start using the "release" features for github

i created a new branch for creating updates on v4 gradio update v4

@daswer123
Copy link
Collaborator

yes i tried to modify them through the tutorial but the version number that my sd showed was not avalible. and when i tried to run the sh build it failed.

Well yes, the last time I did this was for gradio version 3.31.

Yes will need to figure out something to make it work well on the old webui on gradio 3.x and on the new 4.x because they have too different structure.

Actually it's too early to do anything, as they can do the webui structure on gradio 4 is not fully finalized yet, I would wait for this PR to be pushed into the dev branch

@richrobber2 richrobber2 added the help wanted Extra attention is needed label Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants