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
e72adc99
Commit
e72adc99
authored
Oct 08, 2022
by
Trung Ngo
Committed by
AUTOMATIC1111
Oct 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore last generation params
parent
04c0e643
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
1 deletion
+14
-1
.gitignore
.gitignore
+1
-0
javascript/hints.js
javascript/hints.js
+1
-1
modules/generation_parameters_copypaste.py
modules/generation_parameters_copypaste.py
+8
-0
modules/processing.py
modules/processing.py
+4
-0
No files found.
.gitignore
View file @
e72adc99
...
@@ -17,6 +17,7 @@ __pycache__
...
@@ -17,6 +17,7 @@ __pycache__
/webui.settings.bat
/webui.settings.bat
/embeddings
/embeddings
/styles.csv
/styles.csv
/params.txt
/styles.csv.bak
/styles.csv.bak
/webui-user.bat
/webui-user.bat
/webui-user.sh
/webui-user.sh
...
...
javascript/hints.js
View file @
e72adc99
...
@@ -14,7 +14,7 @@ titles = {
...
@@ -14,7 +14,7 @@ titles = {
"
\
u{1f3b2}
\
ufe0f
"
:
"
Set seed to -1, which will cause a new random number to be used every time
"
,
"
\
u{1f3b2}
\
ufe0f
"
:
"
Set seed to -1, which will cause a new random number to be used every time
"
,
"
\
u267b
\
ufe0f
"
:
"
Reuse seed from last generation, mostly useful if it was randomed
"
,
"
\
u267b
\
ufe0f
"
:
"
Reuse seed from last generation, mostly useful if it was randomed
"
,
"
\
u{1f3a8}
"
:
"
Add a random artist to the prompt.
"
,
"
\
u{1f3a8}
"
:
"
Add a random artist to the prompt.
"
,
"
\
u2199
\
ufe0f
"
:
"
Read generation parameters from prompt into user interface.
"
,
"
\
u2199
\
ufe0f
"
:
"
Read generation parameters from prompt
or last generation if prompt is empty
into user interface.
"
,
"
\
u{1f4c2}
"
:
"
Open images output directory
"
,
"
\
u{1f4c2}
"
:
"
Open images output directory
"
,
"
Inpaint a part of image
"
:
"
Draw a mask over an image, and the script will regenerate the masked area with content according to prompt
"
,
"
Inpaint a part of image
"
:
"
Draw a mask over an image, and the script will regenerate the masked area with content according to prompt
"
,
...
...
modules/generation_parameters_copypaste.py
View file @
e72adc99
import
os
import
re
import
re
import
gradio
as
gr
import
gradio
as
gr
from
modules.shared
import
script_path
re_param_code
=
r"\s*([\w ]+):\s*([^,]+)(?:,|$)"
re_param_code
=
r"\s*([\w ]+):\s*([^,]+)(?:,|$)"
re_param
=
re
.
compile
(
re_param_code
)
re_param
=
re
.
compile
(
re_param_code
)
...
@@ -61,6 +63,12 @@ Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 965400086, Size: 512x512, Model
...
@@ -61,6 +63,12 @@ Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 965400086, Size: 512x512, Model
def
connect_paste
(
button
,
paste_fields
,
input_comp
,
js
=
None
):
def
connect_paste
(
button
,
paste_fields
,
input_comp
,
js
=
None
):
def
paste_func
(
prompt
):
def
paste_func
(
prompt
):
if
not
prompt
:
filename
=
os
.
path
.
join
(
script_path
,
"params.txt"
)
if
os
.
path
.
exists
(
filename
):
with
open
(
filename
,
"r"
,
encoding
=
"utf8"
)
as
file
:
prompt
=
file
.
read
()
params
=
parse_generation_parameters
(
prompt
)
params
=
parse_generation_parameters
(
prompt
)
res
=
[]
res
=
[]
...
...
modules/processing.py
View file @
e72adc99
...
@@ -324,6 +324,10 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
...
@@ -324,6 +324,10 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
else
:
else
:
assert
p
.
prompt
is
not
None
assert
p
.
prompt
is
not
None
with
open
(
os
.
path
.
join
(
shared
.
script_path
,
"params.txt"
),
"w"
,
encoding
=
"utf8"
)
as
file
:
processed
=
Processed
(
p
,
[],
p
.
seed
,
""
)
file
.
write
(
processed
.
infotext
(
p
,
0
))
devices
.
torch_gc
()
devices
.
torch_gc
()
seed
=
get_fixed_seed
(
p
.
seed
)
seed
=
get_fixed_seed
(
p
.
seed
)
...
...
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