Skip to content

Conversation

@martinobettucci
Copy link

No description provided.

Doggettx and others added 22 commits September 5, 2022 09:26
Run attention in a loop to allow for much higher resolutions (over 1920x1920 on a 3090)
Correction to comment
Better memory handling for model.decode_first_stage so it doesn't crash anymore after 100% rendering
Old version gave incorrect free memory results causing in crashes on edge cases.
Set model to half in txt2img and img2img for less memory usage.
Forgot to comment out debug info
Technically you could run at higher steps as long as the resolution is dividable by the steps but you're going to run into memory issues later on anyhow.
Improves performance and is no longer needed.
Significant performance boost at higher resolutions when running in auto_cast or half mode

on 3090 went from 1.13it/s to 1.63it/s at 1024x1024

Will also allow for higher resolutions due to sigmoid fix and using half memory
Performance boost and fix sigmoid for higher resolutions
Only need to wrap the model now with PromptGuidanceModelWrapper, and call prepare_prompts. No need to change samplers anymore, for example see changes in txt2img.py

special format inside prompts:
[sentence1:sentence2:step]  will swap sentence1 (or sentence) for sentence2 at step
[sentence:step] will add sentence at step
[:sentence:step] will remove sentence at step
[sentence] will add sentence at step 0 (only useful for negative prompts)
when a sentence starts with - it will be seen as a negative prompt

{scale:step} will switch to defined guidance scale at step, does not work if initial guidance scale was 1.0
Changed attention to code like used in diffusers
* Update attention.py

Run attention in a loop to allow for much higher resolutions (over 1920x1920 on a 3090)

* Update attention.py

Correction to comment

* Update attention.py

* Fixed memory handling for model.decode_first_stage

Better memory handling for model.decode_first_stage so it doesn't crash anymore after 100% rendering

* Fixed free memory calculation

Old version gave incorrect free memory results causing in crashes on edge cases.

* Set model to half

Set model to half in txt2img and img2img for less memory usage.

* Commented out debug info

Forgot to comment out debug info

* Raise error when steps too high

Technically you could run at higher steps as long as the resolution is dividable by the steps but you're going to run into memory issues later on anyhow.

* Added max. res info to memory exception

* Reverted in place tensor functions back to CompVis version

Improves performance and is no longer needed.

* Missed one function to revert

* Update README.md

* Performance boost and fix sigmoid for higher resolutions

Significant performance boost at higher resolutions when running in auto_cast or half mode

on 3090 went from 1.13it/s to 1.63it/s at 1024x1024

Will also allow for higher resolutions due to sigmoid fix and using half memory

Co-authored-by: Doggettx <Doggettpm@protonmail.com>
Co-authored-by: Doggettx <110817577+Doggettx@users.noreply.github.com>
prompt2prompt easier to implement, more options
Signed-off-by: Martino Bettucci <martinobettucci@users.noreply.github.com>
Signed-off-by: Martino Bettucci <martinobettucci@users.noreply.github.com>
@martinobettucci martinobettucci deleted the martinobettucci-patch-1 branch October 26, 2022 17:16
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.

3 participants