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
e9ba2d42
Commit
e9ba2d42
authored
Sep 21, 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
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
3 deletions
+24
-3
javascript/dragdrop.js
javascript/dragdrop.js
+23
-2
modules/ui.py
modules/ui.py
+1
-1
No files found.
javascript/dragdrop.js
View file @
e9ba2d42
...
...
@@ -10,13 +10,34 @@ function dropReplaceImage( imgWrap, files ) {
}
imgWrap
.
querySelector
(
'
.modify-upload button + button, .touch-none + div button + button
'
)?.
click
();
window
.
requestAnimationFrame
(
()
=>
{
const
callback
=
()
=>
{
const
fileInput
=
imgWrap
.
querySelector
(
'
input[type="file"]
'
);
if
(
fileInput
)
{
fileInput
.
files
=
files
;
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
)
{
...
...
modules/ui.py
View file @
e9ba2d42
...
...
@@ -797,7 +797,7 @@ def create_ui(txt2img, img2img, run_extras, run_pnginfo):
pnginfo_interface
=
gr
.
Interface
(
wrap_gradio_call
(
run_pnginfo
),
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
=
[
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