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
523140d7
Commit
523140d7
authored
Oct 16, 2022
by
MalumaDev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ui fix
parent
b694bba3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
14 deletions
+18
-14
modules/aesthetic_clip.py
modules/aesthetic_clip.py
+1
-2
modules/sd_hijack.py
modules/sd_hijack.py
+1
-2
modules/shared.py
modules/shared.py
+2
-0
modules/ui.py
modules/ui.py
+14
-10
No files found.
modules/aesthetic_clip.py
View file @
523140d7
...
...
@@ -74,5 +74,4 @@ def generate_imgs_embd(name, folder, batch_size):
"""
shared
.
update_aesthetic_embeddings
()
return
gr
.
Dropdown
.
update
(
choices
=
sorted
(
shared
.
aesthetic_embeddings
.
keys
()),
label
=
"Imgs embedding"
,
value
=
sorted
(
shared
.
aesthetic_embeddings
.
keys
())[
0
]
if
len
(
shared
.
aesthetic_embeddings
)
>
0
else
None
),
res
,
""
value
=
"None"
),
res
,
""
modules/sd_hijack.py
View file @
523140d7
...
...
@@ -392,8 +392,7 @@ class FrozenCLIPEmbedderWithCustomWords(torch.nn.Module):
z1
=
self
.
process_tokens
(
tokens
,
multipliers
)
z
=
z1
if
z
is
None
else
torch
.
cat
((
z
,
z1
),
axis
=-
2
)
if
len
(
text
[
0
])
!=
0
and
self
.
aesthetic_steps
!=
0
and
self
.
aesthetic_lr
!=
0
and
self
.
aesthetic_weight
!=
0
and
self
.
image_embs_name
!=
None
:
if
self
.
aesthetic_steps
!=
0
and
self
.
aesthetic_lr
!=
0
and
self
.
aesthetic_weight
!=
0
and
self
.
image_embs_name
!=
None
:
if
not
opts
.
use_old_emphasis_implementation
:
remade_batch_tokens
=
[
[
self
.
wrapped
.
tokenizer
.
bos_token_id
]
+
x
[:
75
]
+
[
self
.
wrapped
.
tokenizer
.
eos_token_id
]
for
x
in
...
...
modules/shared.py
View file @
523140d7
...
...
@@ -96,11 +96,13 @@ loaded_hypernetwork = None
aesthetic_embeddings
=
{
f
.
replace
(
".pt"
,
""
):
os
.
path
.
join
(
cmd_opts
.
aesthetic_embeddings_dir
,
f
)
for
f
in
os
.
listdir
(
cmd_opts
.
aesthetic_embeddings_dir
)
if
f
.
endswith
(
".pt"
)}
aesthetic_embeddings
=
aesthetic_embeddings
|
{
"None"
:
None
}
def
update_aesthetic_embeddings
():
global
aesthetic_embeddings
aesthetic_embeddings
=
{
f
.
replace
(
".pt"
,
""
):
os
.
path
.
join
(
cmd_opts
.
aesthetic_embeddings_dir
,
f
)
for
f
in
os
.
listdir
(
cmd_opts
.
aesthetic_embeddings_dir
)
if
f
.
endswith
(
".pt"
)}
aesthetic_embeddings
=
aesthetic_embeddings
|
{
"None"
:
None
}
def
reload_hypernetworks
():
global
hypernetworks
...
...
modules/ui.py
View file @
523140d7
...
...
@@ -594,19 +594,23 @@ def create_ui(wrap_gradio_gpu_call):
height
=
gr
.
Slider
(
minimum
=
64
,
maximum
=
2048
,
step
=
64
,
label
=
"Height"
,
value
=
512
)
with
gr
.
Group
():
aesthetic_lr
=
gr
.
Textbox
(
label
=
'Aesthetic learning rate'
,
placeholder
=
"Aesthetic learning rate"
,
value
=
"0.0001"
)
aesthetic_weight
=
gr
.
Slider
(
minimum
=
0
,
maximum
=
1
,
step
=
0.01
,
label
=
"Aesthetic weight"
,
value
=
0.9
)
aesthetic_steps
=
gr
.
Slider
(
minimum
=
0
,
maximum
=
50
,
step
=
1
,
label
=
"Aesthetic steps"
,
value
=
5
)
with
gr
.
Accordion
(
"Open for Clip Aesthetic!"
,
open
=
False
):
with
gr
.
Row
():
aesthetic_weight
=
gr
.
Slider
(
minimum
=
0
,
maximum
=
1
,
step
=
0.01
,
label
=
"Aesthetic weight"
,
value
=
0.9
)
aesthetic_steps
=
gr
.
Slider
(
minimum
=
0
,
maximum
=
50
,
step
=
1
,
label
=
"Aesthetic steps"
,
value
=
5
)
with
gr
.
Row
():
aesthetic_imgs_text
=
gr
.
Textbox
(
label
=
'Aesthetic text for imgs'
,
placeholder
=
"This text is used to rotate the feature space of the imgs embs"
,
value
=
""
)
aesthetic_slerp_angle
=
gr
.
Slider
(
label
=
'Slerp angle'
,
minimum
=
0
,
maximum
=
1
,
step
=
0.01
,
value
=
0.1
)
aesthetic_text_negative
=
gr
.
Checkbox
(
label
=
"Is negative text"
,
value
=
False
)
with
gr
.
Row
():
aesthetic_lr
=
gr
.
Textbox
(
label
=
'Aesthetic learning rate'
,
placeholder
=
"Aesthetic learning rate"
,
value
=
"0.0001"
)
aesthetic_slerp
=
gr
.
Checkbox
(
label
=
"Slerp interpolation"
,
value
=
False
)
aesthetic_imgs
=
gr
.
Dropdown
(
sorted
(
aesthetic_embeddings
.
keys
()),
label
=
"Aesthetic imgs embedding"
,
value
=
"None"
)
aesthetic_imgs
=
gr
.
Dropdown
(
sorted
(
aesthetic_embeddings
.
keys
()),
label
=
"Aesthetic imgs embedding"
,
value
=
sorted
(
aesthetic_embeddings
.
keys
())[
0
]
if
len
(
aesthetic_embeddings
)
>
0
else
None
)
with
gr
.
Row
():
aesthetic_imgs_text
=
gr
.
Textbox
(
label
=
'Aesthetic text for imgs'
,
placeholder
=
"This text is used to rotate the feature space of the imgs embs"
,
value
=
""
)
aesthetic_slerp_angle
=
gr
.
Slider
(
label
=
'Slerp angle'
,
minimum
=
0
,
maximum
=
1
,
step
=
0.01
,
value
=
0.1
)
aesthetic_text_negative
=
gr
.
Checkbox
(
label
=
"Is negative text"
,
value
=
False
)
aesthetic_slerp
=
gr
.
Checkbox
(
label
=
"Slerp interpolation"
,
value
=
False
)
with
gr
.
Row
():
restore_faces
=
gr
.
Checkbox
(
label
=
'Restore faces'
,
value
=
False
,
visible
=
len
(
shared
.
face_restorers
)
>
1
)
...
...
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