Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
0241d811
Commit
0241d811
authored
Oct 09, 2022
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Fix for Prompts_from_file showing extra textbox."
This reverts commit
e2930f98
.
parent
ab4fe4f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
28 deletions
+4
-28
modules/scripts.py
modules/scripts.py
+4
-28
No files found.
modules/scripts.py
View file @
0241d811
...
@@ -31,15 +31,6 @@ class Script:
...
@@ -31,15 +31,6 @@ class Script:
def
show
(
self
,
is_img2img
):
def
show
(
self
,
is_img2img
):
return
True
return
True
# Called when the ui for this script has been shown.
# Useful for hiding some controls, since the scripts module sets visibility to
# everything to true. The parameters will be the parameters returned by the ui method
# The return value should be gradio updates, similar to what you would return
# from a Gradio event handler.
def
on_show
(
self
,
*
args
):
return
[
ui
.
gr_show
(
True
)]
*
len
(
args
)
# This is where the additional processing is implemented. The parameters include
# This is where the additional processing is implemented. The parameters include
# self, the model object "p" (a StableDiffusionProcessing class, see
# self, the model object "p" (a StableDiffusionProcessing class, see
# processing.py), and the parameters returned by the ui method.
# processing.py), and the parameters returned by the ui method.
...
@@ -134,35 +125,20 @@ class ScriptRunner:
...
@@ -134,35 +125,20 @@ class ScriptRunner:
inputs
+=
controls
inputs
+=
controls
script
.
args_to
=
len
(
inputs
)
script
.
args_to
=
len
(
inputs
)
def
select_script
(
*
args
):
def
select_script
(
script_index
):
script_index
=
args
[
0
]
on_show_updates
=
[]
if
0
<
script_index
<=
len
(
self
.
scripts
):
if
0
<
script_index
<=
len
(
self
.
scripts
):
script
=
self
.
scripts
[
script_index
-
1
]
script
=
self
.
scripts
[
script_index
-
1
]
args_from
=
script
.
args_from
args_from
=
script
.
args_from
args_to
=
script
.
args_to
args_to
=
script
.
args_to
script_args
=
args
[
args_from
:
args_to
]
on_show_updates
=
wrap_call
(
script
.
on_show
,
script
.
filename
,
"on_show"
,
*
script_args
)
if
(
len
(
on_show_updates
)
!=
(
args_to
-
args_from
)):
print
(
"Error in custom script ("
+
script
.
filename
+
"): on_show() method should return the same number of arguments as ui()."
,
file
=
sys
.
stderr
)
else
:
else
:
args_from
=
0
args_from
=
0
args_to
=
0
args_to
=
0
ret
=
[
ui
.
gr_show
(
True
)]
# always show the dropdown
return
[
ui
.
gr_show
(
True
if
i
==
0
else
args_from
<=
i
<
args_to
)
for
i
in
range
(
len
(
inputs
))]
for
i
in
range
(
1
,
len
(
inputs
)):
if
(
args_from
<=
i
<
args_to
):
if
(
i
-
args_from
)
<
len
(
on_show_updates
):
ret
.
append
(
on_show_updates
[
i
-
args_from
]
)
else
:
ret
.
append
(
ui
.
gr_show
(
True
))
else
:
ret
.
append
(
ui
.
gr_show
(
False
))
return
ret
dropdown
.
change
(
dropdown
.
change
(
fn
=
select_script
,
fn
=
select_script
,
inputs
=
inputs
,
inputs
=
[
dropdown
]
,
outputs
=
inputs
outputs
=
inputs
)
)
...
@@ -222,4 +198,4 @@ def reload_scripts(basedir):
...
@@ -222,4 +198,4 @@ def reload_scripts(basedir):
load_scripts
(
basedir
)
load_scripts
(
basedir
)
scripts_txt2img
=
ScriptRunner
()
scripts_txt2img
=
ScriptRunner
()
scripts_img2img
=
ScriptRunner
()
scripts_img2img
=
ScriptRunner
()
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment