Omer Karisman commited on
Commit
85996d4
1 Parent(s): 0497ce6
Files changed (1) hide show
  1. app.py +30 -23
app.py CHANGED
@@ -65,50 +65,47 @@ def generate(
65
  #Move the components in the example fields outside so they are available when gr.Examples is instantiated
66
 
67
  with gr.Blocks() as demo:
68
- gr.Markdown("<h1 style='text-align: center'>Omni Zero</h1>")
69
  gr.Markdown("<h4 style='text-align: center'>A diffusion pipeline for zero-shot stylized portrait creation [<a href='https://github.com/okaris/omni-zero' target='_blank'>GitHub</a>], [<a href='https://styleof.com/s/remix-yourself' target='_blank'>StyleOf Remix Yourself</a>]</h4>")
70
  with gr.Row():
71
  with gr.Column():
72
  with gr.Row():
73
- prompt = gr.Textbox(label="Prompt", value="A person")
74
  with gr.Row():
75
- negative_prompt = gr.Textbox(label="Negative Prompt", value="blurry, out of focus")
76
  with gr.Row():
77
  with gr.Column(min_width=140):
78
  with gr.Row():
79
- composition_image = gr.Image(label="Composition")
80
  with gr.Row():
81
- composition_image_strength = gr.Slider(label="Strength",step=0.01, minimum=0.0, maximum=1.0, value=1.0)
82
  #with gr.Row():
83
  with gr.Column(min_width=140):
84
  with gr.Row():
85
  style_image = gr.Image(label="Style Image")
86
  with gr.Row():
87
  style_image_strength = gr.Slider(label="Strength",step=0.01, minimum=0.0, maximum=1.0, value=1.0)
 
88
  with gr.Column(min_width=140):
89
  with gr.Row():
90
  identity_image = gr.Image(label="Identity Image")
91
  with gr.Row():
92
  identity_image_strength = gr.Slider(label="Strenght",step=0.01, minimum=0.0, maximum=1.0, value=1.0)
93
- with gr.Accordion("Advanced options", open=False):
94
- with gr.Row():
95
- with gr.Column(min_width=140):
96
- with gr.Row():
97
- base_image = gr.Image(label="Base Image")
98
- with gr.Row():
99
- base_image_strength = gr.Slider(label="Strength",step=0.01, minimum=0.0, maximum=1.0, value=0.15, min_width=120)
100
- # with gr.Column(min_width=140):
101
- # with gr.Row():
102
- # depth_image = gr.Image(label="depth_image", value=None)
103
- # with gr.Row():
104
- # depth_image_strength = gr.Slider(label="depth_image_strength",step=0.01, minimum=0.0, maximum=1.0, value=0.5)
105
-
106
  with gr.Row():
107
  seed = gr.Slider(label="Seed",step=1, minimum=0, maximum=10000000, value=42)
108
  number_of_images = gr.Slider(label="Number of Outputs",step=1, minimum=1, maximum=4, value=1)
109
  with gr.Row():
110
  guidance_scale = gr.Slider(label="Guidance Scale",step=0.1, minimum=0.0, maximum=14.0, value=3.0)
111
  number_of_steps = gr.Slider(label="Number of Steps",step=1, minimum=1, maximum=50, value=10)
 
 
 
112
 
113
  with gr.Column():
114
  with gr.Row():
@@ -119,26 +116,36 @@ with gr.Blocks() as demo:
119
 
120
  submit.click(generate, inputs=[
121
  prompt,
122
- composition_image,
123
  style_image,
124
  identity_image,
125
- base_image,
126
  seed,
127
  negative_prompt,
128
  guidance_scale,
129
  number_of_images,
130
  number_of_steps,
131
  base_image_strength,
132
- composition_image_strength,
133
  style_image_strength,
134
  identity_image_strength,
 
 
 
135
  ],
136
  outputs=[out]
137
  )
138
  # clear.click(lambda: None, None, chatbot, queue=False)
139
  gr.Examples(
140
- examples=[["A person", "https://github.com/okaris/omni-zero/assets/1448702/2ca63443-c7f3-4ba6-95c1-2a341414865f", "https://github.com/okaris/omni-zero/assets/1448702/64dc150b-f683-41b1-be23-b6a52c771584", "https://github.com/okaris/omni-zero/assets/1448702/ba193a3a-f90e-4461-848a-560454531c58"]],
141
- inputs=[prompt, composition_image, style_image, identity_image],
 
 
 
 
 
 
 
 
142
  outputs=[out],
143
  fn=generate,
144
  cache_examples="lazy",
 
65
  #Move the components in the example fields outside so they are available when gr.Examples is instantiated
66
 
67
  with gr.Blocks() as demo:
68
+ gr.Markdown("<h1 style='text-align: center'>Omni Zero Couples</h1>")
69
  gr.Markdown("<h4 style='text-align: center'>A diffusion pipeline for zero-shot stylized portrait creation [<a href='https://github.com/okaris/omni-zero' target='_blank'>GitHub</a>], [<a href='https://styleof.com/s/remix-yourself' target='_blank'>StyleOf Remix Yourself</a>]</h4>")
70
  with gr.Row():
71
  with gr.Column():
72
  with gr.Row():
73
+ prompt = gr.Textbox(label="Prompt", value="Cinematic still photo of a couple. emotional, harmonious, vignette, 4k epic detailed, shot on kodak, 35mm photo, sharp focus, high budget, cinemascope, moody, epic, gorgeous, film grain, grainy")
74
  with gr.Row():
75
+ negative_prompt = gr.Textbox(label="Negative Prompt", value="anime, cartoon, graphic, (blur, blurry, bokeh), text, painting, crayon, graphite, abstract, glitch, deformed, mutated, ugly, disfigured")
76
  with gr.Row():
77
  with gr.Column(min_width=140):
78
  with gr.Row():
79
+ base_image = gr.Image(label="Base Image")
80
  with gr.Row():
81
+ base_image_strength = gr.Slider(label="Strength",step=0.01, minimum=0.0, maximum=1.0, value=1.0)
82
  #with gr.Row():
83
  with gr.Column(min_width=140):
84
  with gr.Row():
85
  style_image = gr.Image(label="Style Image")
86
  with gr.Row():
87
  style_image_strength = gr.Slider(label="Strength",step=0.01, minimum=0.0, maximum=1.0, value=1.0)
88
+ with gr.Row():
89
  with gr.Column(min_width=140):
90
  with gr.Row():
91
  identity_image = gr.Image(label="Identity Image")
92
  with gr.Row():
93
  identity_image_strength = gr.Slider(label="Strenght",step=0.01, minimum=0.0, maximum=1.0, value=1.0)
94
+ with gr.Column(min_width=140):
95
+ with gr.Row():
96
+ identity_image_2 = gr.Image(label="Identity Image 2")
97
+ with gr.Row():
98
+ identity_image_strength_2 = gr.Slider(label="Strenght",step=0.01, minimum=0.0, maximum=1.0, value=1.0)
99
+ with gr.Accordion("Advanced options", open=False):
 
 
 
 
 
 
 
100
  with gr.Row():
101
  seed = gr.Slider(label="Seed",step=1, minimum=0, maximum=10000000, value=42)
102
  number_of_images = gr.Slider(label="Number of Outputs",step=1, minimum=1, maximum=4, value=1)
103
  with gr.Row():
104
  guidance_scale = gr.Slider(label="Guidance Scale",step=0.1, minimum=0.0, maximum=14.0, value=3.0)
105
  number_of_steps = gr.Slider(label="Number of Steps",step=1, minimum=1, maximum=50, value=10)
106
+ with gr.Row():
107
+ mask_guidance_start = gr.Slider(label="Mask Guidance Start",step=0.01, minimum=0.0, maximum=1.0, value=0.0)
108
+ mask_guidance_end = gr.Slider(label="Mask Guidance End",step=0.01, minimum=0.0, maximum=1.0, value=1.0)
109
 
110
  with gr.Column():
111
  with gr.Row():
 
116
 
117
  submit.click(generate, inputs=[
118
  prompt,
119
+ base_image,
120
  style_image,
121
  identity_image,
122
+ identity_image_2,
123
  seed,
124
  negative_prompt,
125
  guidance_scale,
126
  number_of_images,
127
  number_of_steps,
128
  base_image_strength,
 
129
  style_image_strength,
130
  identity_image_strength,
131
+ identity_image_strength_2,
132
+ mask_guidance_start,
133
+ mask_guidance_end,
134
  ],
135
  outputs=[out]
136
  )
137
  # clear.click(lambda: None, None, chatbot, queue=False)
138
  gr.Examples(
139
+ examples=[
140
+ [
141
+ "Cinematic still photo of a couple. emotional, harmonious, vignette, 4k epic detailed, shot on kodak, 35mm photo, sharp focus, high budget, cinemascope, moody, epic, gorgeous, film grain, grainy",
142
+ "https://cdn-prod.styleof.com/inferences/cm1ho5cjl14nh14jec6phg2h8/i6k59e7gpsr45ufc7l8kun0g-medium.jpeg",
143
+ "https://cdn-prod.styleof.com/inferences/cm1ho5cjl14nh14jec6phg2h8/i6k59e7gpsr45ufc7l8kun0g-medium.jpeg",
144
+ "https://cdn-prod.styleof.com/inferences/cm1hp4lea14oz14jeoghnex7g/dlgc5xwo0qzey7qaixy45i1o-medium.jpeg",
145
+ "https://cdn-prod.styleof.com/inferences/cm1ho69ha14np14jesnusqiep/mp3aaktzqz20ujco5i3bi5s1-medium.jpeg"
146
+ ]
147
+ ],
148
+ inputs=[prompt, base_image, style_image, identity_image, identity_image_2],
149
  outputs=[out],
150
  fn=generate,
151
  cache_examples="lazy",