diff options
author | JaredTherriault <noirjt@live.com> | 2023-08-28 04:54:05 +0000 |
---|---|---|
committer | JaredTherriault <noirjt@live.com> | 2023-08-28 04:54:05 +0000 |
commit | f3d1631aab82d559294126a9230c979ef4c4e1d6 (patch) | |
tree | 1a130594cd6f1bed415cfc2dfb92253ee059e7de /modules/generation_parameters_copypaste.py | |
parent | c9c8485bc1e8720aba70f029d25cba1c4abf2b5c (diff) | |
download | stable-diffusion-webui-gfx803-f3d1631aab82d559294126a9230c979ef4c4e1d6.tar.gz stable-diffusion-webui-gfx803-f3d1631aab82d559294126a9230c979ef4c4e1d6.tar.bz2 stable-diffusion-webui-gfx803-f3d1631aab82d559294126a9230c979ef4c4e1d6.zip |
Offloading custom work
-custom_statics works to do mass replace strings, intended for copy-pasting gen info from internet generations and replacing unsavory prompts with safer prompts for my own sanity
-tried to implement this into generation_parameters_copypaste but it didn't work out this iteration, presumably because we return a string and the calling method is looking for an object type
-updated webui-user.bat to set a custom temp directory (for disk space concerns) and to apply xformers (for generation speed)
I probably won't be merging any of this work into the main repo since I don't want to mess with anyone else's prompts, this is just intended to keep my workspace safe from anything I don't want to see. Eventually this should be done in an extension which I could then publish, but I need to learn a lot more about the extension and callback systems in the main repo first. just uploading this to my fork for now so i don't lose the current progress.
Diffstat (limited to 'modules/generation_parameters_copypaste.py')
-rw-r--r-- | modules/generation_parameters_copypaste.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/generation_parameters_copypaste.py b/modules/generation_parameters_copypaste.py index a3448be9..bd7b0018 100644 --- a/modules/generation_parameters_copypaste.py +++ b/modules/generation_parameters_copypaste.py @@ -370,6 +370,14 @@ def connect_paste(button, paste_fields, input_comp, override_settings_component, prompt = file.read()
params = parse_generation_parameters(prompt)
+
+ # This sanitizes unsavory prompt words when copying from another image
+ # for my own sanity. This is not intended to be contributed to the main repo,
+ # it's just so I don't have to see anything I'm not interested in when batch
+ # reproducing images from civit.ai or elsewhere when working on loras
+ # todo: make this work with the callback instead of forcing it here, this can be an extension when I feel like putting it together :D
+ from modules import custom_statics
+ params = custom_statics.CustomStatics.mass_replace_strings(params)
script_callbacks.infotext_pasted_callback(prompt, params)
res = []
|