aboutsummaryrefslogtreecommitdiffstats
path: root/modules/custom_statics.py
diff options
context:
space:
mode:
authorJaredTherriault <noirjt@live.com>2023-09-03 20:31:42 +0000
committerJaredTherriault <noirjt@live.com>2023-09-03 20:32:56 +0000
commit8f3b02f09535f55d3673aa9ea589396b8614f799 (patch)
tree572e29867d4df32cf33df284cf96e8611b78045c /modules/custom_statics.py
parentf3d1631aab82d559294126a9230c979ef4c4e1d6 (diff)
downloadstable-diffusion-webui-gfx803-8f3b02f09535f55d3673aa9ea589396b8614f799.tar.gz
stable-diffusion-webui-gfx803-8f3b02f09535f55d3673aa9ea589396b8614f799.tar.bz2
stable-diffusion-webui-gfx803-8f3b02f09535f55d3673aa9ea589396b8614f799.zip
Revert "Offloading custom work"
This reverts commit f3d1631aab82d559294126a9230c979ef4c4e1d6. This work has been offloaded now into an extension called Prompt Control.
Diffstat (limited to 'modules/custom_statics.py')
-rw-r--r--modules/custom_statics.py29
1 files changed, 0 insertions, 29 deletions
diff --git a/modules/custom_statics.py b/modules/custom_statics.py
deleted file mode 100644
index 207bd5fb..00000000
--- a/modules/custom_statics.py
+++ /dev/null
@@ -1,29 +0,0 @@
-import os
-import gc
-import re
-
-import modules.paths as paths
-
-class CustomStatics:
-
- @staticmethod
- # loads a file with strings structured as below, on each line with a : between the search and replace strings, into a list
- # search0:replace0
- # search string:replace string
- #
- # Then replaces all occurrences of the list's search strings with the list's replace strings in one go
- def mass_replace_strings(input_string):
- with open(os.path.join(paths.data_path, "custom_statics/Replacements.txt"), "r", encoding="utf8") as file:
- replacements = file.readlines()
-
- replacement_dict = {}
- for line in replacements:
- search, replace = line.strip().split(":")
- replacement_dict[search] = replace
-
- def replace(match_text):
- return replacement_dict[match_text.group(0)]
-
- return re.sub('|'.join(r'\b%s\b' % re.escape(s) for s in replacement_dict.keys()), replace, str(input_string))
-
- return str(geninfo) \ No newline at end of file