Spaces:
Running
on
Zero
Running
on
Zero
zhiweili
commited on
Commit
•
623b249
1
Parent(s):
8050b98
test p2p
Browse files- app_haircolor_img2img.py +4 -2
app_haircolor_img2img.py
CHANGED
@@ -77,13 +77,15 @@ def image_to_image(
|
|
77 |
time_cost_str = ''
|
78 |
run_task_time, time_cost_str = get_time_cost(run_task_time, time_cost_str)
|
79 |
|
|
|
|
|
80 |
# generator = torch.Generator(device=DEVICE).manual_seed(seed)
|
81 |
generated_image = basepipeline(
|
82 |
seeds=[seed],
|
83 |
# generator=generator,
|
84 |
prompt=edit_prompt,
|
85 |
negative_prompt=DEFAULT_NEGATIVE_PROMPT,
|
86 |
-
image=
|
87 |
height=generate_size,
|
88 |
width=generate_size,
|
89 |
guidance_scale=guidance_scale,
|
@@ -124,7 +126,7 @@ def create_demo() -> gr.Blocks:
|
|
124 |
edit_prompt = gr.Textbox(lines=1, label="Edit Prompt", value=DEFAULT_EDIT_PROMPT)
|
125 |
generate_size = gr.Number(label="Generate Size", value=512)
|
126 |
with gr.Column():
|
127 |
-
num_steps = gr.Slider(minimum=1, maximum=100, value=
|
128 |
guidance_scale = gr.Slider(minimum=0, maximum=30, value=5, step=0.5, label="Guidance Scale")
|
129 |
with gr.Column():
|
130 |
with gr.Accordion("Advanced Options", open=False):
|
|
|
77 |
time_cost_str = ''
|
78 |
run_task_time, time_cost_str = get_time_cost(run_task_time, time_cost_str)
|
79 |
|
80 |
+
cond_image = [input_image]
|
81 |
+
|
82 |
# generator = torch.Generator(device=DEVICE).manual_seed(seed)
|
83 |
generated_image = basepipeline(
|
84 |
seeds=[seed],
|
85 |
# generator=generator,
|
86 |
prompt=edit_prompt,
|
87 |
negative_prompt=DEFAULT_NEGATIVE_PROMPT,
|
88 |
+
image=cond_image,
|
89 |
height=generate_size,
|
90 |
width=generate_size,
|
91 |
guidance_scale=guidance_scale,
|
|
|
126 |
edit_prompt = gr.Textbox(lines=1, label="Edit Prompt", value=DEFAULT_EDIT_PROMPT)
|
127 |
generate_size = gr.Number(label="Generate Size", value=512)
|
128 |
with gr.Column():
|
129 |
+
num_steps = gr.Slider(minimum=1, maximum=100, value=20, step=1, label="Num Steps")
|
130 |
guidance_scale = gr.Slider(minimum=0, maximum=30, value=5, step=0.5, label="Guidance Scale")
|
131 |
with gr.Column():
|
132 |
with gr.Accordion("Advanced Options", open=False):
|