Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
5a477d4
1
Parent(s):
ad9dc8a
update
Browse files- app.py +14 -2
- example_images/01.jpg +0 -0
app.py
CHANGED
@@ -38,7 +38,7 @@ ip_model = NestedAdapterInference(
|
|
38 |
)
|
39 |
|
40 |
# Generation defaults
|
41 |
-
negative_prompt = "monochrome, lowres,
|
42 |
num_inference_steps = 30
|
43 |
guidance_scale = 5.0
|
44 |
|
@@ -77,7 +77,7 @@ def generate_images(img1, img2, img3, prompt, w, num_samples, seed):
|
|
77 |
# Gradio UI
|
78 |
# ----------------------
|
79 |
with gr.Blocks() as demo:
|
80 |
-
gr.Markdown("##
|
81 |
gr.Markdown(
|
82 |
"Upload up to 3 reference images. "
|
83 |
"Faces will be auto-aligned before personalization. Include the placeholder token (e.g., \\<person\\>) in your prompt, "
|
@@ -95,6 +95,18 @@ with gr.Blocks() as demo:
|
|
95 |
num_samples_input = gr.Slider(minimum=1, maximum=6, step=1, value=4, label="Number of Images to Generate")
|
96 |
seed_input = gr.Slider(minimum=-1, maximum=100000, step=1, value=-1, label="Random Seed (use -1 for random and up to 100000)")
|
97 |
generate_button = gr.Button("Generate Images")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
98 |
with gr.Column(scale=1):
|
99 |
output_gallery = gr.Gallery(label="Generated Images", columns=3)
|
100 |
|
|
|
38 |
)
|
39 |
|
40 |
# Generation defaults
|
41 |
+
negative_prompt = "bad anatomy, monochrome, lowres, worst quality, low quality"
|
42 |
num_inference_steps = 30
|
43 |
guidance_scale = 5.0
|
44 |
|
|
|
77 |
# Gradio UI
|
78 |
# ----------------------
|
79 |
with gr.Blocks() as demo:
|
80 |
+
gr.Markdown("## Nested Attention: Semantic-aware Attention Values for Concept Personalization")
|
81 |
gr.Markdown(
|
82 |
"Upload up to 3 reference images. "
|
83 |
"Faces will be auto-aligned before personalization. Include the placeholder token (e.g., \\<person\\>) in your prompt, "
|
|
|
95 |
num_samples_input = gr.Slider(minimum=1, maximum=6, step=1, value=4, label="Number of Images to Generate")
|
96 |
seed_input = gr.Slider(minimum=-1, maximum=100000, step=1, value=-1, label="Random Seed (use -1 for random and up to 100000)")
|
97 |
generate_button = gr.Button("Generate Images")
|
98 |
+
|
99 |
+
# Add examples
|
100 |
+
gr.Examples(
|
101 |
+
examples=[
|
102 |
+
["example_images/01.jpg", None, None, "a pop figure of a <person>, she stands on a white background", 2.0, 4, 1],
|
103 |
+
["example_images/01.jpg", None, None, "a watercolor painting of a <person>, closeup", 1.0, 4, 42],
|
104 |
+
["example_images/01.jpg", None, None, "a high quality photo of a <person> as a firefighter", 3.0, 4, 10],
|
105 |
+
],
|
106 |
+
inputs=[img1, img2, img3, prompt_input, w_input, num_samples_input, seed_input],
|
107 |
+
label="Example Prompts"
|
108 |
+
)
|
109 |
+
|
110 |
with gr.Column(scale=1):
|
111 |
output_gallery = gr.Gallery(label="Generated Images", columns=3)
|
112 |
|
example_images/01.jpg
ADDED
![]() |