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
3c207ca6
Commit
3c207ca6
authored
Oct 29, 2022
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add needed imports fr new code in copypaste.py
parent
45ca67f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
modules/generation_parameters_copypaste.py
modules/generation_parameters_copypaste.py
+9
-0
modules/ui.py
modules/ui.py
+0
-7
No files found.
modules/generation_parameters_copypaste.py
View file @
3c207ca6
import
base64
import
io
import
os
import
re
import
gradio
as
gr
...
...
@@ -14,6 +16,7 @@ type_of_gr_update = type(gr.update())
paste_fields
=
{}
bind_list
=
[]
def
quote
(
text
):
if
','
not
in
str
(
text
):
return
text
...
...
@@ -23,6 +26,7 @@ def quote(text):
text
=
text
.
replace
(
'"'
,
'
\\
"'
)
return
f
'"{text}"'
def
image_from_url_text
(
filedata
):
if
type
(
filedata
)
==
dict
and
filedata
[
"is_file"
]:
filename
=
filedata
[
"name"
]
...
...
@@ -45,19 +49,23 @@ def image_from_url_text(filedata):
image
=
Image
.
open
(
io
.
BytesIO
(
filedata
))
return
image
def
add_paste_fields
(
tabname
,
init_img
,
fields
):
paste_fields
[
tabname
]
=
{
"init_img"
:
init_img
,
"fields"
:
fields
}
def
create_buttons
(
tabs_list
):
buttons
=
{}
for
tab
in
tabs_list
:
buttons
[
tab
]
=
gr
.
Button
(
f
"Send to {tab}"
)
return
buttons
#if send_generate_info is a tab name, mean generate_info comes from the params fields of the tab
def
bind_buttons
(
buttons
,
send_image
,
send_generate_info
):
bind_list
.
append
([
buttons
,
send_image
,
send_generate_info
])
def
run_bind
():
for
buttons
,
send_image
,
send_generate_info
in
bind_list
:
for
tab
in
buttons
:
...
...
@@ -98,6 +106,7 @@ def run_bind():
outputs
=
None
,
)
def
parse_generation_parameters
(
x
:
str
):
"""parses generation parameters string, the one you see in text field under the picture in UI:
```
...
...
modules/ui.py
View file @
3c207ca6
import
base64
import
html
import
io
import
json
import
math
import
mimetypes
...
...
@@ -18,13 +16,8 @@ import gradio as gr
import
gradio.routes
import
gradio.utils
import
numpy
as
np
import
piexif
import
torch
from
PIL
import
Image
,
PngImagePlugin
import
gradio
as
gr
import
gradio.utils
import
gradio.routes
from
modules
import
sd_hijack
,
sd_models
,
localization
,
script_callbacks
from
modules.paths
import
script_path
...
...
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