Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -414,7 +414,7 @@ def infer_compo(style_description, ref_style_file, caption, ref_sub_file):
|
|
414 |
# Reset the state after inference, regardless of success or failure
|
415 |
reset_compo_inference_state()
|
416 |
|
417 |
-
def run(
|
418 |
result = None
|
419 |
if use_subject_ref is True:
|
420 |
result = infer_compo(style_description, style_reference_image, subject_prompt, subject_reference)
|
@@ -454,6 +454,14 @@ with gr.Blocks() as demo:
|
|
454 |
subject_reference = gr.Image(type="filepath")
|
455 |
use_subject_ref = gr.Checkbox(label="Use Subject Image as Reference", value=False)
|
456 |
submit_btn = gr.Button("Submit")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
457 |
with gr.Column():
|
458 |
output_image = gr.Image(label="Output Image")
|
459 |
'''
|
@@ -465,7 +473,7 @@ with gr.Blocks() as demo:
|
|
465 |
'''
|
466 |
submit_btn.click(
|
467 |
fn = run,
|
468 |
-
inputs = [
|
469 |
outputs = [output_image]
|
470 |
)
|
471 |
|
|
|
414 |
# Reset the state after inference, regardless of success or failure
|
415 |
reset_compo_inference_state()
|
416 |
|
417 |
+
def run(style_reference_image, style_description, subject_prompt, subject_reference, use_subject_ref):
|
418 |
result = None
|
419 |
if use_subject_ref is True:
|
420 |
result = infer_compo(style_description, style_reference_image, subject_prompt, subject_reference)
|
|
|
454 |
subject_reference = gr.Image(type="filepath")
|
455 |
use_subject_ref = gr.Checkbox(label="Use Subject Image as Reference", value=False)
|
456 |
submit_btn = gr.Button("Submit")
|
457 |
+
|
458 |
+
gr.Examples(
|
459 |
+
examples = [
|
460 |
+
["./data/cyberpunk.png","cyberpunk art style","a car",None,False ],
|
461 |
+
["./data/melting_gold.png", "melting golden 3D rendering style", "a dog", "./data/dog.jpg", True]
|
462 |
+
],
|
463 |
+
inputs=[style_reference_image, style_description, subject_prompt, subject_reference, use_subject_ref]
|
464 |
+
)
|
465 |
with gr.Column():
|
466 |
output_image = gr.Image(label="Output Image")
|
467 |
'''
|
|
|
473 |
'''
|
474 |
submit_btn.click(
|
475 |
fn = run,
|
476 |
+
inputs = [style_reference_image, style_description, subject_prompt, subject_reference, use_subject_ref],
|
477 |
outputs = [output_image]
|
478 |
)
|
479 |
|