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

Add Cutn to the web interface sidebar. #20

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

ZeroCool940711
Copy link

This PR adds a small but kind of important QOL change that I made, it will add an option to customize the Cutn value from the web interface.

image

By having an option to change the number of cuts or cutn value we can reduce the amount of VRAM the app uses and so we can use higher resolutions than we were able to use before, for comparison, when using the previous default value which was 64 cutn I could only use a resolution of up to 400x400 with my Nvidia RTX 3050, after having an option to customize the cutn when using a value of 32 cutn I can use a resolution up to 512x512 and with a value of 25 cutn I was able to get up 1024x1024 a couple of times before adding any other option. It does come with some downsides but it's better to have the option to adjust that value than not having it at all. With a lower number of cuts we use less VRAM but the quality of the result image also decrease, a higher number of cuts give a better quality but also uses more VRAM on your GPU, if I'm not mistaken this is the value that is sent to CLIP to match the image to the text prompt, the more cuts we sent the better idea CLIP has of our current image and so it can match the text to the image better.

I also modified the environment.yml file so we can use a newer version of pytorch, torchvision and pytorch-lightning.

…and step size/learning rate.

- Added a small try block for the prev_image.png to reduce an issue that happens when the image is open on an external program and the model tries to load or save the file which resulted in a error, this should happen less frequently.
- Added some extra information to the Streamlit progress bar, as I was not able to replace it by the stqdm library I tried to implement some of the features of said library like the number of iterations per seconds.
- Added some lines to save the image of each step/frame that was created, these are the same images used to create the video when we hit the stop button, this should be useful to see step by step what the app has done as sometimes the video might be too fast or too low quality to see correctly what it has done.
- Fixed an issue where the app could not run using the CPU only as it was by default trying to use at least one GPU.
- Changed the format of the Zoom Factor field on the sidebar from "%.1e" to "%.4f", this should give better control of small increments and a better idea of what value it currently has.
… the new changes would throw an error or you would need to manually change these files for it to work.
@lgtm-com
Copy link

lgtm-com bot commented Aug 23, 2022

This pull request introduces 3 alerts when merging dbb5546 into 82aff79 - view on LGTM.com

new alerts:

  • 3 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Aug 23, 2022

This pull request introduces 3 alerts when merging eb8577b into 82aff79 - view on LGTM.com

new alerts:

  • 3 for Unused import

…e and limited the float to 2 decimal places so it looks better. This is only shown when using a fixed number of steps and the percent will not show if the number of steps is -1 as when using -1 its supposed to run until you stop it so there is no point in showing the progress bar and the percent completed.
… the way to access this exception on the newest version of the library.
@lgtm-com
Copy link

lgtm-com bot commented Aug 24, 2022

This pull request introduces 3 alerts when merging 7adecea into 82aff79 - view on LGTM.com

new alerts:

  • 3 for Unused import

…use. By default it will be using the Adam optimizer, just like before, but a few others have been added to the drop menu under this option.
…h-optimizer is used for a few options on the list of customizable optimizers from the previous commit while retry is used to avoid a small issue when saving the preview image to disk where some times it could make the whole app crash if the file was been written to fast to disk and an external image viewer had the image open, this would raise a PermissionError or OSError, with the retry library we give it a couple of tries without crashing the app.
@lgtm-com
Copy link

lgtm-com bot commented Aug 25, 2022

This pull request introduces 3 alerts when merging 29e90b2 into 82aff79 - view on LGTM.com

new alerts:

  • 3 for Unused import

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant