diff options
author | Dement242 <113772485+Dement242@users.noreply.github.com> | 2022-09-17 21:18:56 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-17 21:18:56 +0000 |
commit | 3a050d19c6ce9c8cc838bd3c924eb43a34ca5309 (patch) | |
tree | c486fbd3d80cd7d449fed9e4ec0d35ad4894c14d /modules | |
parent | 33434fc6fc32987d56f8c402450c05b0a5a0164b (diff) | |
parent | 8ff6f093206111940e2601187f3f208d761543d6 (diff) | |
download | stable-diffusion-webui-gfx803-3a050d19c6ce9c8cc838bd3c924eb43a34ca5309.tar.gz stable-diffusion-webui-gfx803-3a050d19c6ce9c8cc838bd3c924eb43a34ca5309.tar.bz2 stable-diffusion-webui-gfx803-3a050d19c6ce9c8cc838bd3c924eb43a34ca5309.zip |
Merge branch 'AUTOMATIC1111:master' into Dement242-patch-1
Diffstat (limited to 'modules')
-rw-r--r-- | modules/scripts.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/modules/scripts.py b/modules/scripts.py index 9cc5a185..0e0b949b 100644 --- a/modules/scripts.py +++ b/modules/scripts.py @@ -13,18 +13,37 @@ class Script: args_from = None
args_to = None
+ # The title of the script. This is what will be displayed in the dropdown menu.
def title(self):
raise NotImplementedError()
+ # How the script is displayed in the UI. See https://gradio.app/docs/#components
+ # for the different UI components you can use and how to create them.
+ # Most UI components can return a value, such as a boolean for a checkbox.
+ # The returned values are passed to the run method as parameters.
def ui(self, is_img2img):
pass
+ # Determines when the script should be shown in the dropdown menu via the
+ # returned value. As an example:
+ # is_img2img is True if the current tab is img2img, and False if it is txt2img.
+ # Thus, return is_img2img to only show the script on the img2img tab.
def show(self, is_img2img):
return True
+ # This is where the additional processing is implemented. The parameters include
+ # self, the model object "p" (a StableDiffusionProcessing class, see
+ # processing.py), and the parameters returned by the ui method.
+ # Custom functions can be defined here, and additional libraries can be imported
+ # to be used in processing. The return value should be a Processed object, which is
+ # what is returned by the process_images method.
def run(self, *args):
raise NotImplementedError()
+ # The description method is currently unused.
+ # To add a description that appears when hovering over the title, amend the "titles"
+ # dict in script.js to include the script title (returned by title) as a key, and
+ # your description as the value.
def describe(self):
return ""
|