kadirnar commited on
Commit
95f082f
1 Parent(s): 81b62ca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -19,7 +19,6 @@ best_model_list = [
19
  orig_prompt = "Create a relaxing atmosphere with the use of plants and other natural elements. Such as a hanging terrarium or a wall-mounted planter. Include plenty of storage options to keep the space organized and clutter-free. Consider adding a vanity with double sinks and plenty of drawers and cabinets. As well as a wall mounted medicine and towel storage."
20
  orig_negative_prompt = "lurry, bad art, blurred, text, watermark"
21
 
22
-
23
  def stable_diffusion_zoom_out(
24
  repo_id,
25
  original_prompt,
@@ -29,7 +28,7 @@ def stable_diffusion_zoom_out(
29
  image_size=512,
30
  fps=16
31
  ):
32
- pipe = DiffusionPipeline.from_pretrained(repo_id, torch_dtype=torch.float16, revision="fp16")
33
  pipe.set_use_memory_efficient_attention_xformers(True)
34
  pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
35
  pipe = pipe.to("cuda")
@@ -71,17 +70,23 @@ def stable_diffusion_zoom_out(
71
  write_video(save_path, all_frames, fps=fps)
72
  return save_path
73
 
 
74
  inputs = [
75
  gr.Dropdown(choices=best_model_list,default="stabilityai/stable-diffusion-2-inpainting", label="Model"),
76
  gr.inputs.Textbox(lines=1, default=orig_prompt, label="Prompt"),
77
  gr.inputs.Textbox(lines=1, default=orig_negative_prompt, label="Negative Prompt"),
78
  gr.inputs.Slider(minimum=1, maximum=64, default=32, label="Steps"),
79
  gr.inputs.Slider(minimum=1, maximum=500, default=10, step=10, label="Frames"),
80
- gr.inputs.Slider(minimum=128, maximum=1024, default=512, step=256, label="Image Size"),
81
  gr.inputs.Slider(minimum=1, maximum=100, default=16, step=1, label="FPS")
82
  ]
83
 
84
  output = gr.outputs.Video()
 
 
 
 
 
85
  title = "Stable Diffusion Infinite Zoom Out"
86
 
87
  demo_app = gr.Interface(
 
19
  orig_prompt = "Create a relaxing atmosphere with the use of plants and other natural elements. Such as a hanging terrarium or a wall-mounted planter. Include plenty of storage options to keep the space organized and clutter-free. Consider adding a vanity with double sinks and plenty of drawers and cabinets. As well as a wall mounted medicine and towel storage."
20
  orig_negative_prompt = "lurry, bad art, blurred, text, watermark"
21
 
 
22
  def stable_diffusion_zoom_out(
23
  repo_id,
24
  original_prompt,
 
28
  image_size=512,
29
  fps=16
30
  ):
31
+ pipe = DiffusionPipeline.from_pretrained(repo_id, torch_dtype=torch.float16)
32
  pipe.set_use_memory_efficient_attention_xformers(True)
33
  pipe.scheduler = DPMSolverMultistepScheduler.from_config(pipe.scheduler.config)
34
  pipe = pipe.to("cuda")
 
70
  write_video(save_path, all_frames, fps=fps)
71
  return save_path
72
 
73
+
74
  inputs = [
75
  gr.Dropdown(choices=best_model_list,default="stabilityai/stable-diffusion-2-inpainting", label="Model"),
76
  gr.inputs.Textbox(lines=1, default=orig_prompt, label="Prompt"),
77
  gr.inputs.Textbox(lines=1, default=orig_negative_prompt, label="Negative Prompt"),
78
  gr.inputs.Slider(minimum=1, maximum=64, default=32, label="Steps"),
79
  gr.inputs.Slider(minimum=1, maximum=500, default=10, step=10, label="Frames"),
80
+ gr.inputs.Slider(minimum=128, maximum=1024, default=512, step=32, label="Image Size"),
81
  gr.inputs.Slider(minimum=1, maximum=100, default=16, step=1, label="FPS")
82
  ]
83
 
84
  output = gr.outputs.Video()
85
+ examples = [
86
+ ["stabilityai/stable-diffusion-2-inpainting", orig_prompt, orig_negative_prompt, 32, 10, 512, 16],
87
+ ["prompthero/openjourney", orig_prompt, orig_negative_prompt, 32, 10, 512, 16]
88
+ ]
89
+
90
  title = "Stable Diffusion Infinite Zoom Out"
91
 
92
  demo_app = gr.Interface(