diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2022-09-17 20:45:10 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-17 20:45:10 +0000 |
commit | 8ff6f093206111940e2601187f3f208d761543d6 (patch) | |
tree | ac1cb35d515d4d1f8f9dedd42bb95b81acb83353 /scripts/custom_code.py | |
parent | 23a0ec04c005957091ab35c26c4c31485e75d146 (diff) | |
parent | 98a6644bcff5765b916af6234448f6bf3dbffddc (diff) | |
download | stable-diffusion-webui-gfx803-8ff6f093206111940e2601187f3f208d761543d6.tar.gz stable-diffusion-webui-gfx803-8ff6f093206111940e2601187f3f208d761543d6.tar.bz2 stable-diffusion-webui-gfx803-8ff6f093206111940e2601187f3f208d761543d6.zip |
Merge pull request #587 from JashoBell/Base
Basic documentation for custom_code.py template
Diffstat (limited to 'scripts/custom_code.py')
-rw-r--r-- | scripts/custom_code.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/custom_code.py b/scripts/custom_code.py index 5694f2dd..a9b10c09 100644 --- a/scripts/custom_code.py +++ b/scripts/custom_code.py @@ -4,8 +4,8 @@ import gradio as gr from modules.processing import Processed
from modules.shared import opts, cmd_opts, state
-
class Script(scripts.Script):
+
def title(self):
return "Custom code"
@@ -18,6 +18,7 @@ class Script(scripts.Script): return [code]
+
def run(self, p, code):
assert cmd_opts.allow_code, '--allow-code option must be enabled'
@@ -37,4 +38,5 @@ class Script(scripts.Script): exec(compiled, module.__dict__)
return Processed(p, *display_result_data)
-
+
+
\ No newline at end of file |