Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stable-diffusion-webui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
stable-diffusion-webui
Commits
e9ba2d42
Commit
e9ba2d42
authored
Sep 20, 2022
by
Connum
Committed by
AUTOMATIC1111
Sep 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix image replacement via clipboard paste or drag and drop on PNG Info tab
parent
29d6084f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
3 deletions
+24
-3
dragdrop.js
javascript/dragdrop.js
+23
-2
ui.py
modules/ui.py
+1
-1
No files found.
javascript/dragdrop.js
View file @
e9ba2d42
...
@@ -10,13 +10,34 @@ function dropReplaceImage( imgWrap, files ) {
...
@@ -10,13 +10,34 @@ function dropReplaceImage( imgWrap, files ) {
}
}
imgWrap
.
querySelector
(
'.modify-upload button + button, .touch-none + div button + button'
)?.
click
();
imgWrap
.
querySelector
(
'.modify-upload button + button, .touch-none + div button + button'
)?.
click
();
window
.
requestAnimationFrame
(
()
=>
{
const
callback
=
()
=>
{
const
fileInput
=
imgWrap
.
querySelector
(
'input[type="file"]'
);
const
fileInput
=
imgWrap
.
querySelector
(
'input[type="file"]'
);
if
(
fileInput
)
{
if
(
fileInput
)
{
fileInput
.
files
=
files
;
fileInput
.
files
=
files
;
fileInput
.
dispatchEvent
(
new
Event
(
'change'
));
fileInput
.
dispatchEvent
(
new
Event
(
'change'
));
}
}
});
};
if
(
imgWrap
.
closest
(
'#pnginfo_image'
)
)
{
// special treatment for PNG Info tab, wait for fetch request to finish
const
oldFetch
=
window
.
fetch
;
window
.
fetch
=
async
(
input
,
options
)
=>
{
const
response
=
await
oldFetch
(
input
,
options
);
if
(
'api/predict/'
===
input
)
{
const
content
=
await
response
.
text
();
window
.
fetch
=
oldFetch
;
window
.
requestAnimationFrame
(
()
=>
callback
()
);
return
new
Response
(
content
,
{
status
:
response
.
status
,
statusText
:
response
.
statusText
,
headers
:
response
.
headers
})
}
return
response
;
};
}
else
{
window
.
requestAnimationFrame
(
()
=>
callback
()
);
}
}
}
function
pressClearBtn
(
hoverElems
)
{
function
pressClearBtn
(
hoverElems
)
{
...
...
modules/ui.py
View file @
e9ba2d42
...
@@ -797,7 +797,7 @@ def create_ui(txt2img, img2img, run_extras, run_pnginfo):
...
@@ -797,7 +797,7 @@ def create_ui(txt2img, img2img, run_extras, run_pnginfo):
pnginfo_interface
=
gr
.
Interface
(
pnginfo_interface
=
gr
.
Interface
(
wrap_gradio_call
(
run_pnginfo
),
wrap_gradio_call
(
run_pnginfo
),
inputs
=
[
inputs
=
[
gr
.
Image
(
label
=
"Source"
,
source
=
"upload"
,
interactive
=
True
,
type
=
"pil"
),
gr
.
Image
(
elem_id
=
"pnginfo_image"
,
label
=
"Source"
,
source
=
"upload"
,
interactive
=
True
,
type
=
"pil"
),
],
],
outputs
=
[
outputs
=
[
gr
.
HTML
(),
gr
.
HTML
(),
...
...
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