Not image refere
Browse files
app.py
CHANGED
|
@@ -22,7 +22,7 @@ MAX_IMAGE_SIZE = 1024
|
|
| 22 |
|
| 23 |
|
| 24 |
@spaces.GPU
|
| 25 |
-
def infer(prompt,
|
| 26 |
|
| 27 |
# init_image = refer_image.resize((1024, 1024))
|
| 28 |
|
|
@@ -68,21 +68,12 @@ with gr.Blocks(css=css) as demo:
|
|
| 68 |
container=False,
|
| 69 |
)
|
| 70 |
|
| 71 |
-
refer_image = gr.Image(show_label=True, label="Reference image")
|
| 72 |
-
|
| 73 |
run_button = gr.Button("Run", scale=0)
|
| 74 |
|
| 75 |
result = gr.Image(label="Result", show_label=True)
|
| 76 |
|
| 77 |
with gr.Accordion("Advanced Settings", open=False):
|
| 78 |
|
| 79 |
-
negative_prompt = gr.TextArea(
|
| 80 |
-
label="Negative prompt",
|
| 81 |
-
max_lines=1,
|
| 82 |
-
placeholder="Default Negative prompt: avoid multiple versions of Xavy, avoid distorted facial features, malformed hands, excessive or broken gadgets, unrealistic proportions in the body or technology, extra limbs",
|
| 83 |
-
visible=False,
|
| 84 |
-
)
|
| 85 |
-
|
| 86 |
seed = gr.Slider(
|
| 87 |
label="Seed",
|
| 88 |
minimum=0,
|
|
@@ -140,7 +131,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 140 |
gr.on(
|
| 141 |
triggers=[run_button.click, prompt.submit],
|
| 142 |
fn=infer,
|
| 143 |
-
inputs=[prompt,
|
| 144 |
outputs=[result]
|
| 145 |
)
|
| 146 |
|
|
|
|
| 22 |
|
| 23 |
|
| 24 |
@spaces.GPU
|
| 25 |
+
def infer(prompt, height, width):
|
| 26 |
|
| 27 |
# init_image = refer_image.resize((1024, 1024))
|
| 28 |
|
|
|
|
| 68 |
container=False,
|
| 69 |
)
|
| 70 |
|
|
|
|
|
|
|
| 71 |
run_button = gr.Button("Run", scale=0)
|
| 72 |
|
| 73 |
result = gr.Image(label="Result", show_label=True)
|
| 74 |
|
| 75 |
with gr.Accordion("Advanced Settings", open=False):
|
| 76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
seed = gr.Slider(
|
| 78 |
label="Seed",
|
| 79 |
minimum=0,
|
|
|
|
| 131 |
gr.on(
|
| 132 |
triggers=[run_button.click, prompt.submit],
|
| 133 |
fn=infer,
|
| 134 |
+
inputs=[prompt, height, width],
|
| 135 |
outputs=[result]
|
| 136 |
)
|
| 137 |
|