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
f30a2deb
Commit
f30a2deb
authored
Feb 27, 2023
by
comfyanonymous
Browse files
Switch the CLIPTextEncode div to a textarea.
parent
d826a097
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
webshit/index.html
webshit/index.html
+8
-6
No files found.
webshit/index.html
View file @
f30a2deb
...
@@ -203,8 +203,8 @@ function onObjectInfo(json) {
...
@@ -203,8 +203,8 @@ function onObjectInfo(json) {
type
:
"
customtext
"
,
type
:
"
customtext
"
,
name
:
x
,
name
:
x
,
dynamic_prompt
:
dynamic_prompt
,
dynamic_prompt
:
dynamic_prompt
,
get
value
()
{
return
this
.
input_div
.
innerText
;},
get
value
()
{
return
this
.
input_div
.
value
;},
set
value
(
x
)
{
this
.
input_div
.
innerText
=
x
;},
set
value
(
x
)
{
this
.
input_div
.
value
=
x
;},
callback
:
function
(
v
){
console
.
log
(
v
);},
callback
:
function
(
v
){
console
.
log
(
v
);},
options
:
{},
options
:
{},
draw
:
function
(
ctx
,
node
,
widget_width
,
y
,
H
){
draw
:
function
(
ctx
,
node
,
widget_width
,
y
,
H
){
...
@@ -235,13 +235,15 @@ function onObjectInfo(json) {
...
@@ -235,13 +235,15 @@ function onObjectInfo(json) {
ctx
.
restore
();
ctx
.
restore
();
},
},
};
};
w
.
input_div
=
document
.
createElement
(
'
div
'
);
w
.
input_div
=
document
.
createElement
(
'
textarea
'
);
w
.
input_div
.
contentEditable
=
true
;
w
.
input_div
.
contentEditable
=
true
;
w
.
input_div
.
className
=
"
customtext_input
"
;
w
.
input_div
.
className
=
"
customtext_input
"
;
w
.
input_div
.
style
.
overflow
=
'
hidden
'
;
w
.
input_div
.
style
.
overflow
=
'
hidden
'
;
w
.
input_div
.
style
.
overflowY
=
'
auto
'
;
w
.
input_div
.
style
.
overflowY
=
'
auto
'
;
w
.
input_div
.
style
.
padding
=
2
;
w
.
input_div
.
style
.
padding
=
2
;
w
.
input_div
.
innerText
=
default_val
;
w
.
input_div
.
style
.
resize
=
'
none
'
;
w
.
input_div
.
style
.
border
=
'
none
'
;
w
.
input_div
.
value
=
default_val
;
document
.
addEventListener
(
'
click
'
,
function
(
event
)
{
document
.
addEventListener
(
'
click
'
,
function
(
event
)
{
if
(
!
w
.
input_div
.
contains
(
event
.
target
))
{
if
(
!
w
.
input_div
.
contains
(
event
.
target
))
{
w
.
input_div
.
blur
();
w
.
input_div
.
blur
();
...
@@ -536,10 +538,10 @@ function graphToPrompt() {
...
@@ -536,10 +538,10 @@ function graphToPrompt() {
// store the unresolved prompt to restore it after sending the resolved prompt to the backend
// store the unresolved prompt to restore it after sending the resolved prompt to the backend
// use of .innerText which keep \n symbols in order to not break multilines support
// use of .innerText which keep \n symbols in order to not break multilines support
widget
.
value_initial
=
widget
.
input_div
.
innerText
;
widget
.
value_initial
=
widget
.
input_div
.
value
;
// resolve the string
// resolve the string
var
prompt
=
widget
.
input_div
.
innerText
;
var
prompt
=
widget
.
input_div
.
value
;
while
(
prompt
.
replace
(
"
\\
{
"
,
""
).
includes
(
'
{
'
)
&&
prompt
.
replace
(
"
\\
}
"
,
""
).
includes
(
'
}
'
))
{
while
(
prompt
.
replace
(
"
\\
{
"
,
""
).
includes
(
'
{
'
)
&&
prompt
.
replace
(
"
\\
}
"
,
""
).
includes
(
'
}
'
))
{
const
startIndex
=
prompt
.
replace
(
"
\\
{
"
,
"
00
"
).
indexOf
(
'
{
'
);
const
startIndex
=
prompt
.
replace
(
"
\\
{
"
,
"
00
"
).
indexOf
(
'
{
'
);
const
endIndex
=
prompt
.
replace
(
"
\\
}
"
,
"
00
"
).
indexOf
(
'
}
'
);
const
endIndex
=
prompt
.
replace
(
"
\\
}
"
,
"
00
"
).
indexOf
(
'
}
'
);
...
...
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