sandz7 commited on
Commit
705f145
Β·
verified Β·
1 Parent(s): 641e431

placed else condition for chatinterface

Browse files
Files changed (1) hide show
  1. app.py +14 -27
app.py CHANGED
@@ -156,14 +156,14 @@ def diffusing(prompt: str,
156
  # Generate image based on text
157
  image_base = base(
158
  prompt=prompt,
159
- num_inference_steps=n_steps,
160
- denoising_end=high_noise_frac,
161
  output_type="latent"
162
  ).images
163
  image = refiner(
164
  prompt=prompt,
165
- num_inference_steps=n_steps,
166
- denoising_start=high_noise_frac,
167
  image=image_base
168
  ).images[0]
169
 
@@ -292,29 +292,16 @@ with gr.Blocks(fill_height=True) as demo:
292
  inputs="text",
293
  outputs="image",
294
  fill_height=True,
295
- additional_inputs_accordion=gr.Accordion(label="βš™οΈ Parameters", open=False, render=False),
296
- additional_inputs=[
297
- gr.Slider(minimum=20,
298
- maximum=100,
299
- step=1,
300
- value=40,
301
- label="Number of Inference Steps",
302
- render=False),
303
- gr.Slider(minimum=0.0,
304
- maximum=1.0,
305
- step=0.1,
306
- value=0.8,
307
- label="High Noise Fraction",
308
- render=False),
309
- ],
310
- examples=[
311
- ["A sprawling cyberpunk metropolis at dusk, with towering skyscrapers adorned with neon signs, holographic billboards, and flying cars weaving through the sky. On a crowded street corner, a cybernetically enhanced street artist creates mesmerizing light sculptures with their augmented reality gloves. Rain glistens on the bustling sidewalks as pedestrians with colorful umbrellas rush past."],
312
- ["A mystical enchanted forest bathed in twilight, where bioluminescent plants cast an ethereal glow. A crystal-clear waterfall cascades into a shimmering pool, surrounded by ancient trees with twisted roots. A lone elf archer, dressed in elegant green and gold attire, stands on a moss-covered rock, her bow drawn as she watches over the tranquil scene. Ethereal fairies with delicate wings flutter around, leaving trails of sparkling dust in the air."],
313
- ["An elaborate steampunk dirigible floating gracefully above a cloud-covered landscape. The airship, with its brass and copper gears, massive steam-powered engines, and ornate Victorian design, cruises past a golden sunset. A distinguished gentleman in a top hat and goggles stands on the observation deck, holding a brass spyglass to his eye as he surveys the horizon. Passengers in vintage attire marvel at the view."],
314
- ["A charming, snow-covered log cabin nestled in the heart of a tranquil mountain range during a starry winter night. Smoke gently curls from the stone chimney, and warm light spills from the windows, illuminating the cozy interior. A young woman in a thick woolen coat and a fur-lined hat stands by the front door, holding a lantern that casts a warm glow on the snow. Pine trees, heavy with snow, frame the scene, while the Northern Lights dance across the sky."],
315
- ["A vibrant underwater kingdom where a colorful coral reef teems with marine life. Schools of iridescent fish swim through the crystal-clear waters, and a sunken pirate ship, encrusted with barnacles and treasure chests, rests on the sandy seabed. A curious mermaid with flowing turquoise hair and a shimmering silver tail explores the depths, holding a glowing pearl in her hand. Playful dolphins swim around her, and a wise old sea turtle watches from a nearby rock."]
316
- ],
317
- cache_examples=False
318
  )
319
 
320
  if __name__ == "__main__":
 
156
  # Generate image based on text
157
  image_base = base(
158
  prompt=prompt,
159
+ num_inference_steps=40,
160
+ denoising_end=0.8,
161
  output_type="latent"
162
  ).images
163
  image = refiner(
164
  prompt=prompt,
165
+ num_inference_steps=40,
166
+ denoising_start=0.8,
167
  image=image_base
168
  ).images[0]
169
 
 
292
  inputs="text",
293
  outputs="image",
294
  fill_height=True,
295
+ )
296
+
297
+ else:
298
+ print(f"\n|now on chat interface|\n")
299
+ gr.ChatInterface(
300
+ fn=bot_comms,
301
+ chatbot=chatbot,
302
+ fill_height=True,
303
+ multimodal=True,
304
+ textbox=chat_input,
 
 
 
 
 
 
 
 
 
 
 
 
 
305
  )
306
 
307
  if __name__ == "__main__":