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
ee015a1a
Commit
ee015a1a
authored
Oct 12, 2022
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
change textual inversion tab to train
remake train interface to use tabs
parent
2fffd4bd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
14 deletions
+10
-14
modules/hypernetworks/hypernetwork.py
modules/hypernetworks/hypernetwork.py
+1
-1
modules/ui.py
modules/ui.py
+9
-13
No files found.
modules/hypernetworks/hypernetwork.py
View file @
ee015a1a
...
@@ -175,7 +175,7 @@ def attention_CrossAttention_forward(self, x, context=None, mask=None):
...
@@ -175,7 +175,7 @@ def attention_CrossAttention_forward(self, x, context=None, mask=None):
def
train_hypernetwork
(
hypernetwork_name
,
learn_rate
,
data_root
,
log_directory
,
steps
,
create_image_every
,
save_hypernetwork_every
,
template_file
,
preview_image_prompt
):
def
train_hypernetwork
(
hypernetwork_name
,
learn_rate
,
data_root
,
log_directory
,
steps
,
create_image_every
,
save_hypernetwork_every
,
template_file
,
preview_image_prompt
):
assert
hypernetwork_name
,
'
embedding
not selected'
assert
hypernetwork_name
,
'
hypernetwork
not selected'
path
=
shared
.
hypernetworks
.
get
(
hypernetwork_name
,
None
)
path
=
shared
.
hypernetworks
.
get
(
hypernetwork_name
,
None
)
shared
.
loaded_hypernetwork
=
Hypernetwork
()
shared
.
loaded_hypernetwork
=
Hypernetwork
()
...
...
modules/ui.py
View file @
ee015a1a
...
@@ -1035,14 +1035,14 @@ def create_ui(wrap_gradio_gpu_call):
...
@@ -1035,14 +1035,14 @@ def create_ui(wrap_gradio_gpu_call):
sd_hijack
.
model_hijack
.
embedding_db
.
load_textual_inversion_embeddings
()
sd_hijack
.
model_hijack
.
embedding_db
.
load_textual_inversion_embeddings
()
with
gr
.
Blocks
()
as
t
extual_inversio
n_interface
:
with
gr
.
Blocks
()
as
t
rai
n_interface
:
with
gr
.
Row
()
.
style
(
equal_height
=
False
):
with
gr
.
Row
()
.
style
(
equal_height
=
False
):
with
gr
.
Column
():
gr
.
HTML
(
value
=
"<p style='margin-bottom: 0.7em'>See <b><a href=
\"
https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Textual-Inversion
\"
>wiki</a></b> for detailed explanation.</p>"
)
with
gr
.
Group
():
gr
.
HTML
(
value
=
"<p style='margin-bottom: 0.7em'>See <b><a href=
\"
https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Textual-Inversion
\"
>wiki</a></b> for detailed explanation.</p>"
)
gr
.
HTML
(
value
=
"<p style='margin-bottom: 0.7em'>Create a new embedding</p>"
)
with
gr
.
Row
()
.
style
(
equal_height
=
False
):
with
gr
.
Tabs
(
elem_id
=
"train_tabs"
):
with
gr
.
Tab
(
label
=
"Create embedding"
):
new_embedding_name
=
gr
.
Textbox
(
label
=
"Name"
)
new_embedding_name
=
gr
.
Textbox
(
label
=
"Name"
)
initialization_text
=
gr
.
Textbox
(
label
=
"Initialization text"
,
value
=
"*"
)
initialization_text
=
gr
.
Textbox
(
label
=
"Initialization text"
,
value
=
"*"
)
nvpt
=
gr
.
Slider
(
label
=
"Number of vectors per token"
,
minimum
=
1
,
maximum
=
75
,
step
=
1
,
value
=
1
)
nvpt
=
gr
.
Slider
(
label
=
"Number of vectors per token"
,
minimum
=
1
,
maximum
=
75
,
step
=
1
,
value
=
1
)
...
@@ -1054,9 +1054,7 @@ def create_ui(wrap_gradio_gpu_call):
...
@@ -1054,9 +1054,7 @@ def create_ui(wrap_gradio_gpu_call):
with
gr
.
Column
():
with
gr
.
Column
():
create_embedding
=
gr
.
Button
(
value
=
"Create embedding"
,
variant
=
'primary'
)
create_embedding
=
gr
.
Button
(
value
=
"Create embedding"
,
variant
=
'primary'
)
with
gr
.
Group
():
with
gr
.
Tab
(
label
=
"Create hypernetwork"
):
gr
.
HTML
(
value
=
"<p style='margin-bottom: 0.7em'>Create a new hypernetwork</p>"
)
new_hypernetwork_name
=
gr
.
Textbox
(
label
=
"Name"
)
new_hypernetwork_name
=
gr
.
Textbox
(
label
=
"Name"
)
new_hypernetwork_sizes
=
gr
.
CheckboxGroup
(
label
=
"Modules"
,
value
=
[
"768"
,
"320"
,
"640"
,
"1280"
],
choices
=
[
"768"
,
"320"
,
"640"
,
"1280"
])
new_hypernetwork_sizes
=
gr
.
CheckboxGroup
(
label
=
"Modules"
,
value
=
[
"768"
,
"320"
,
"640"
,
"1280"
],
choices
=
[
"768"
,
"320"
,
"640"
,
"1280"
])
...
@@ -1067,9 +1065,7 @@ def create_ui(wrap_gradio_gpu_call):
...
@@ -1067,9 +1065,7 @@ def create_ui(wrap_gradio_gpu_call):
with
gr
.
Column
():
with
gr
.
Column
():
create_hypernetwork
=
gr
.
Button
(
value
=
"Create hypernetwork"
,
variant
=
'primary'
)
create_hypernetwork
=
gr
.
Button
(
value
=
"Create hypernetwork"
,
variant
=
'primary'
)
with
gr
.
Group
():
with
gr
.
Tab
(
label
=
"Preprocess images"
):
gr
.
HTML
(
value
=
"<p style='margin-bottom: 0.7em'>Preprocess images</p>"
)
process_src
=
gr
.
Textbox
(
label
=
'Source directory'
)
process_src
=
gr
.
Textbox
(
label
=
'Source directory'
)
process_dst
=
gr
.
Textbox
(
label
=
'Destination directory'
)
process_dst
=
gr
.
Textbox
(
label
=
'Destination directory'
)
process_width
=
gr
.
Slider
(
minimum
=
64
,
maximum
=
2048
,
step
=
64
,
label
=
"Width"
,
value
=
512
)
process_width
=
gr
.
Slider
(
minimum
=
64
,
maximum
=
2048
,
step
=
64
,
label
=
"Width"
,
value
=
512
)
...
@@ -1091,7 +1087,7 @@ def create_ui(wrap_gradio_gpu_call):
...
@@ -1091,7 +1087,7 @@ def create_ui(wrap_gradio_gpu_call):
with
gr
.
Column
():
with
gr
.
Column
():
run_preprocess
=
gr
.
Button
(
value
=
"Preprocess"
,
variant
=
'primary'
)
run_preprocess
=
gr
.
Button
(
value
=
"Preprocess"
,
variant
=
'primary'
)
with
gr
.
Group
(
):
with
gr
.
Tab
(
label
=
"Train"
):
gr
.
HTML
(
value
=
"<p style='margin-bottom: 0.7em'>Train an embedding; must specify a directory with a set of 1:1 ratio images</p>"
)
gr
.
HTML
(
value
=
"<p style='margin-bottom: 0.7em'>Train an embedding; must specify a directory with a set of 1:1 ratio images</p>"
)
train_embedding_name
=
gr
.
Dropdown
(
label
=
'Embedding'
,
choices
=
sorted
(
sd_hijack
.
model_hijack
.
embedding_db
.
word_embeddings
.
keys
()))
train_embedding_name
=
gr
.
Dropdown
(
label
=
'Embedding'
,
choices
=
sorted
(
sd_hijack
.
model_hijack
.
embedding_db
.
word_embeddings
.
keys
()))
train_hypernetwork_name
=
gr
.
Dropdown
(
label
=
'Hypernetwork'
,
choices
=
[
x
for
x
in
shared
.
hypernetworks
.
keys
()])
train_hypernetwork_name
=
gr
.
Dropdown
(
label
=
'Hypernetwork'
,
choices
=
[
x
for
x
in
shared
.
hypernetworks
.
keys
()])
...
@@ -1388,7 +1384,7 @@ Requested path was: {f}
...
@@ -1388,7 +1384,7 @@ Requested path was: {f}
(
extras_interface
,
"Extras"
,
"extras"
),
(
extras_interface
,
"Extras"
,
"extras"
),
(
pnginfo_interface
,
"PNG Info"
,
"pnginfo"
),
(
pnginfo_interface
,
"PNG Info"
,
"pnginfo"
),
(
modelmerger_interface
,
"Checkpoint Merger"
,
"modelmerger"
),
(
modelmerger_interface
,
"Checkpoint Merger"
,
"modelmerger"
),
(
t
extual_inversion_interface
,
"Textual inversio
n"
,
"ti"
),
(
t
rain_interface
,
"Trai
n"
,
"ti"
),
(
settings_interface
,
"Settings"
,
"settings"
),
(
settings_interface
,
"Settings"
,
"settings"
),
]
]
...
...
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