Spaces:
Runtime error
Runtime error
Update app_inference.py
Browse files- app_inference.py +16 -9
app_inference.py
CHANGED
|
@@ -33,12 +33,16 @@ css = """
|
|
| 33 |
#title h1 {
|
| 34 |
font-size: 250%;
|
| 35 |
}
|
| 36 |
-
|
| 37 |
.lora-title {
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
}
|
| 43 |
|
| 44 |
.gr-image {
|
|
@@ -49,13 +53,10 @@ css = """
|
|
| 49 |
}
|
| 50 |
|
| 51 |
.res-image {
|
| 52 |
-
width: 720px;
|
| 53 |
-
height: 720px;
|
| 54 |
object-fit: contain;
|
| 55 |
margin: auto;
|
| 56 |
}
|
| 57 |
|
| 58 |
-
|
| 59 |
.lora-column {
|
| 60 |
display: flex;
|
| 61 |
flex-direction: column;
|
|
@@ -193,7 +194,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 193 |
max_lines=1,
|
| 194 |
placeholder='Example: "A [c] in [s] style"'
|
| 195 |
)
|
| 196 |
-
result = gr.
|
| 197 |
with gr.Accordion('Other Parameters', open=False, elem_classes="gr-accordion"):
|
| 198 |
content_alpha = gr.Slider(label='Content B-LoRA alpha',
|
| 199 |
minimum=0,
|
|
@@ -220,6 +221,11 @@ with gr.Blocks(css=css) as demo:
|
|
| 220 |
maximum=50,
|
| 221 |
step=0.1,
|
| 222 |
value=7.5)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 223 |
run_button = gr.Button('Generate')
|
| 224 |
demo.load(demo_init, inputs=[],
|
| 225 |
outputs=[content_lora_model_id, content_prompt, content_image, style_lora_model_id, style_prompt,
|
|
@@ -263,6 +269,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 263 |
seed,
|
| 264 |
num_steps,
|
| 265 |
guidance_scale,
|
|
|
|
| 266 |
]
|
| 267 |
prompt.submit(fn=pipe.run, inputs=inputs, outputs=result)
|
| 268 |
run_button.click(fn=pipe.run, inputs=inputs, outputs=result)
|
|
|
|
| 33 |
#title h1 {
|
| 34 |
font-size: 250%;
|
| 35 |
}
|
| 36 |
+
|
| 37 |
.lora-title {
|
| 38 |
+
background-image: linear-gradient(to right, #314755 0%, #26a0da 51%, #314755 100%);
|
| 39 |
+
text-align: center;
|
| 40 |
+
border-radius: 10px;
|
| 41 |
+
display: block;
|
| 42 |
+
}
|
| 43 |
+
|
| 44 |
+
.lora-title h2 {
|
| 45 |
+
color: white !important;
|
| 46 |
}
|
| 47 |
|
| 48 |
.gr-image {
|
|
|
|
| 53 |
}
|
| 54 |
|
| 55 |
.res-image {
|
|
|
|
|
|
|
| 56 |
object-fit: contain;
|
| 57 |
margin: auto;
|
| 58 |
}
|
| 59 |
|
|
|
|
| 60 |
.lora-column {
|
| 61 |
display: flex;
|
| 62 |
flex-direction: column;
|
|
|
|
| 194 |
max_lines=1,
|
| 195 |
placeholder='Example: "A [c] in [s] style"'
|
| 196 |
)
|
| 197 |
+
result = gr.Gallery(label='Result', elem_classes="res-image")
|
| 198 |
with gr.Accordion('Other Parameters', open=False, elem_classes="gr-accordion"):
|
| 199 |
content_alpha = gr.Slider(label='Content B-LoRA alpha',
|
| 200 |
minimum=0,
|
|
|
|
| 221 |
maximum=50,
|
| 222 |
step=0.1,
|
| 223 |
value=7.5)
|
| 224 |
+
num_images_per_prompt = gr.Slider(label='Number of Images per Prompt',
|
| 225 |
+
minimum=1,
|
| 226 |
+
maximum=4,
|
| 227 |
+
step=1,
|
| 228 |
+
value=4)
|
| 229 |
run_button = gr.Button('Generate')
|
| 230 |
demo.load(demo_init, inputs=[],
|
| 231 |
outputs=[content_lora_model_id, content_prompt, content_image, style_lora_model_id, style_prompt,
|
|
|
|
| 269 |
seed,
|
| 270 |
num_steps,
|
| 271 |
guidance_scale,
|
| 272 |
+
num_images_per_prompt
|
| 273 |
]
|
| 274 |
prompt.submit(fn=pipe.run, inputs=inputs, outputs=result)
|
| 275 |
run_button.click(fn=pipe.run, inputs=inputs, outputs=result)
|