Spaces:
Runtime error
Runtime error
update examples
Browse files
app.py
CHANGED
|
@@ -83,9 +83,11 @@ def generate_image(ref_image, ref_image2, prompt, height=512, width=512, num_ste
|
|
| 83 |
|
| 84 |
|
| 85 |
examples = [
|
| 86 |
-
["assets/ref1.jpg",
|
| 87 |
-
["assets/ref1.jpg", "
|
| 88 |
-
["assets/ref2.jpg",
|
|
|
|
|
|
|
| 89 |
|
| 90 |
]
|
| 91 |
|
|
@@ -93,14 +95,15 @@ with gr.Blocks() as demo:
|
|
| 93 |
# Top-level inputs that are always visible
|
| 94 |
with gr.Row():
|
| 95 |
gr.Markdown("""
|
| 96 |
-
## Character Consistancy Image Generation based on Flux
|
|
|
|
| 97 |
""")
|
| 98 |
|
| 99 |
with gr.Row():
|
| 100 |
with gr.Column():
|
| 101 |
with gr.Row():
|
| 102 |
ref_image = gr.Image(type="pil", label="Upload Reference Subject Image", width=300)
|
| 103 |
-
ref_image2 = gr.Image(type="pil", label="[Optional]
|
| 104 |
description = gr.Textbox(lines=2, placeholder="Describe the desired contents", label="Description Text")
|
| 105 |
generate_btn = gr.Button("Generate Image")
|
| 106 |
|
|
@@ -113,20 +116,20 @@ with gr.Blocks() as demo:
|
|
| 113 |
ref_scale_slider = gr.Slider(minimum=0.0, maximum=2.0, value=1.0, step=0.1, label="Reference Image Scale")
|
| 114 |
|
| 115 |
with gr.Column():
|
| 116 |
-
output = gr.Image(type="pil", label="Generated Image")
|
| 117 |
# with gr.Row():
|
| 118 |
-
with gr.Group():
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
|
| 125 |
with gr.Row():
|
| 126 |
gr.Examples(
|
| 127 |
label='Click on following examples to load and try',
|
| 128 |
examples=examples,
|
| 129 |
-
inputs=[ref_image,
|
| 130 |
fn=generate_image,
|
| 131 |
outputs=output,
|
| 132 |
# example_labels=['Reference Subject', 'Additional Reference', 'Prompt', 'Height', 'Width'],
|
|
|
|
| 83 |
|
| 84 |
|
| 85 |
examples = [
|
| 86 |
+
["assets/ref1.jpg", "A woman dancing in the dessert", 512, 768],
|
| 87 |
+
["assets/ref1.jpg", "A woman holding a gray and white cat", 768, 512],
|
| 88 |
+
["assets/ref2.jpg", "A woman having dinner at a table", 512, 768],
|
| 89 |
+
["assets/ref3.jpg", "A woman walking in a park with trees and flowers", 512, 768],
|
| 90 |
+
["assets/ref4.jpg", "A woman run across a busy street", 512, 768],
|
| 91 |
|
| 92 |
]
|
| 93 |
|
|
|
|
| 95 |
# Top-level inputs that are always visible
|
| 96 |
with gr.Row():
|
| 97 |
gr.Markdown("""
|
| 98 |
+
## Character Consistancy Image Generation based on Flux
|
| 99 |
+
- This model is continuously improving until it meets high standards for open-sourcing, currently good enough at generating consistent images of single human subject.
|
| 100 |
""")
|
| 101 |
|
| 102 |
with gr.Row():
|
| 103 |
with gr.Column():
|
| 104 |
with gr.Row():
|
| 105 |
ref_image = gr.Image(type="pil", label="Upload Reference Subject Image", width=300)
|
| 106 |
+
ref_image2 = gr.Image(type="pil", label="[Optional] complement image or additional image from different category", width=200)
|
| 107 |
description = gr.Textbox(lines=2, placeholder="Describe the desired contents", label="Description Text")
|
| 108 |
generate_btn = gr.Button("Generate Image")
|
| 109 |
|
|
|
|
| 116 |
ref_scale_slider = gr.Slider(minimum=0.0, maximum=2.0, value=1.0, step=0.1, label="Reference Image Scale")
|
| 117 |
|
| 118 |
with gr.Column():
|
| 119 |
+
output = gr.Image(type="pil", label="Generated Image", )
|
| 120 |
# with gr.Row():
|
| 121 |
+
# with gr.Group():
|
| 122 |
+
# with gr.Row(equal_height=True):
|
| 123 |
+
# with gr.Column(scale=1, min_width=50, ):
|
| 124 |
+
# randomize_checkbox = gr.Checkbox(label="Randomize Seed", value=True)
|
| 125 |
+
# with gr.Column(scale=3, min_width=100):
|
| 126 |
+
# seed_io = gr.Number(label="Seed (if not randomizing)", value=0, interactive=True, )
|
| 127 |
|
| 128 |
with gr.Row():
|
| 129 |
gr.Examples(
|
| 130 |
label='Click on following examples to load and try',
|
| 131 |
examples=examples,
|
| 132 |
+
inputs=[ref_image, description, height_slider, width_slider],
|
| 133 |
fn=generate_image,
|
| 134 |
outputs=output,
|
| 135 |
# example_labels=['Reference Subject', 'Additional Reference', 'Prompt', 'Height', 'Width'],
|