Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
23507882
Unverified
Commit
23507882
authored
Feb 25, 2023
by
pythongosssss
Committed by
GitHub
Feb 25, 2023
Browse files
Added open image in new tab menu item
Shifted image down on SaveImage node
parent
8ca346b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
webshit/index.html
webshit/index.html
+17
-0
No files found.
webshit/index.html
View file @
23507882
...
...
@@ -264,6 +264,15 @@ function onObjectInfo(json) {
this
.
addInput
(
x
,
type
);
}
MyNode
.
prototype
.
getExtraMenuOptions
=
function
(
graph
,
options
)
{
if
(
this
.
img
)
{
options
.
unshift
({
content
:
"
Open Image
"
,
callback
:
()
=>
window
.
open
(
this
.
img
.
src
,
"
_blank
"
)
});
}
}
MyNode
.
prototype
.
onDrawBackground
=
function
(
ctx
)
{
if
(
!
this
.
flags
.
collapsed
)
{
const
output
=
nodeOutputs
[
this
.
id
+
""
];
...
...
@@ -287,6 +296,10 @@ function onObjectInfo(json) {
let
h
=
this
.
img
.
naturalHeight
;
let
dw
=
this
.
size
[
0
];
let
dh
=
this
.
size
[
1
];
if
(
this
.
type
===
"
SaveImage
"
)
{
dh
-=
55
;
}
const
scaleX
=
dw
/
w
;
const
scaleY
=
dh
/
h
;
...
...
@@ -298,6 +311,10 @@ function onObjectInfo(json) {
let
x
=
(
dw
-
w
)
/
2
;
let
y
=
(
dh
-
h
)
/
2
;
if
(
this
.
type
===
"
SaveImage
"
)
{
y
+=
55
;
}
ctx
.
drawImage
(
this
.
img
,
x
,
y
,
w
,
h
);
}
}
...
...
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