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
fengzch-das
nunchaku
Commits
b2a817c8
Unverified
Commit
b2a817c8
authored
May 17, 2025
by
Muyang Li
Committed by
GitHub
May 17, 2025
Browse files
fix: fix the pix2pix-turbo demo (#373)
parent
3bef6f22
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
app/flux.1/sketch/run_gradio.py
app/flux.1/sketch/run_gradio.py
+5
-1
No files found.
app/flux.1/sketch/run_gradio.py
View file @
b2a817c8
...
@@ -65,7 +65,11 @@ def save_image(img):
...
@@ -65,7 +65,11 @@ def save_image(img):
def
run
(
image
,
prompt
:
str
,
prompt_template
:
str
,
sketch_guidance
:
float
,
seed
:
int
)
->
tuple
[
Image
,
str
]:
def
run
(
image
,
prompt
:
str
,
prompt_template
:
str
,
sketch_guidance
:
float
,
seed
:
int
)
->
tuple
[
Image
,
str
]:
print
(
f
"Prompt:
{
prompt
}
"
)
print
(
f
"Prompt:
{
prompt
}
"
)
image_numpy
=
np
.
array
(
image
[
"composite"
].
convert
(
"RGB"
))
if
image
[
"composite"
]
is
None
:
image_numpy
=
np
.
array
(
blank_image
.
convert
(
"RGB"
))
else
:
image_numpy
=
np
.
array
(
image
[
"composite"
].
convert
(
"RGB"
))
if
prompt
.
strip
()
==
""
and
(
np
.
sum
(
image_numpy
==
255
)
>=
3145628
or
np
.
sum
(
image_numpy
==
0
)
>=
3145628
):
if
prompt
.
strip
()
==
""
and
(
np
.
sum
(
image_numpy
==
255
)
>=
3145628
or
np
.
sum
(
image_numpy
==
0
)
>=
3145628
):
return
blank_image
,
"Please input the prompt or draw something."
return
blank_image
,
"Please input the prompt or draw something."
...
...
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