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
PhotoMaker
Commits
2c02012d
Commit
2c02012d
authored
Jul 30, 2024
by
chenpangpang
Browse files
feat: 删除Debug字样避免误会
parent
aae34b1f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
PhotoMaker/gradio_demo/app.py
PhotoMaker/gradio_demo/app.py
+2
-2
No files found.
PhotoMaker/gradio_demo/app.py
View file @
2c02012d
...
@@ -72,7 +72,7 @@ def generate_image(upload_images, prompt, negative_prompt, aspect_ratio_name, st
...
@@ -72,7 +72,7 @@ def generate_image(upload_images, prompt, negative_prompt, aspect_ratio_name, st
# determine output dimensions by the aspect ratio
# determine output dimensions by the aspect ratio
output_w
,
output_h
=
aspect_ratios
[
aspect_ratio_name
]
output_w
,
output_h
=
aspect_ratios
[
aspect_ratio_name
]
print
(
f
"
[Debug]
Generate image using aspect ratio [
{
aspect_ratio_name
}
] =>
{
output_w
}
x
{
output_h
}
"
)
print
(
f
"Generate image using aspect ratio [
{
aspect_ratio_name
}
] =>
{
output_w
}
x
{
output_h
}
"
)
# apply the style template
# apply the style template
prompt
,
negative_prompt
=
apply_style
(
style_name
,
prompt
,
negative_prompt
)
prompt
,
negative_prompt
=
apply_style
(
style_name
,
prompt
,
negative_prompt
)
...
@@ -87,7 +87,7 @@ def generate_image(upload_images, prompt, negative_prompt, aspect_ratio_name, st
...
@@ -87,7 +87,7 @@ def generate_image(upload_images, prompt, negative_prompt, aspect_ratio_name, st
generator
=
torch
.
Generator
(
device
=
device
).
manual_seed
(
seed
)
generator
=
torch
.
Generator
(
device
=
device
).
manual_seed
(
seed
)
print
(
"Start inference..."
)
print
(
"Start inference..."
)
print
(
f
"
[Debug]
Prompt:
{
prompt
}
,
\n
[Debug]
Neg Prompt:
{
negative_prompt
}
"
)
print
(
f
"Prompt:
{
prompt
}
,
\n
Neg Prompt:
{
negative_prompt
}
"
)
start_merge_step
=
int
(
float
(
style_strength_ratio
)
/
100
*
num_steps
)
start_merge_step
=
int
(
float
(
style_strength_ratio
)
/
100
*
num_steps
)
if
start_merge_step
>
30
:
if
start_merge_step
>
30
:
start_merge_step
=
30
start_merge_step
=
30
...
...
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