Yjiggfghhjnjj commited on
Commit
c329200
1 Parent(s): a3d322a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -2
app.py CHANGED
@@ -40,6 +40,16 @@ RealVisXLv4_pipe = DiffusionPipeline.from_pretrained(
40
  variant="fp16"
41
  )
42
  RealVisXLv4_pipe.to("cuda")
 
 
 
 
 
 
 
 
 
 
43
 
44
  @spaces.GPU
45
  def run_comparison(prompt: str,
@@ -81,7 +91,18 @@ def run_comparison(prompt: str,
81
  ).images
82
  image_paths_r4 = [save_image(img) for img in image_r4]
83
 
84
- return image_paths_r3, image_paths_r4, seed
 
 
 
 
 
 
 
 
 
 
 
85
 
86
  examples = ["A dignified beaver wearing glasses, a vest, and colorful neck tie.",
87
  "The spirit of a tamagotchi wandering in the city of Barcelona",
@@ -163,7 +184,10 @@ with gr.Blocks() as demo:
163
  with gr.Column():
164
  image_r4 = gr.Gallery(label="RealVisXL V4",columns=1, preview=True,)
165
  gr.Markdown("## [RealVisXL V3](https://huggingface.co)")
166
- image_outputs = [image_r3, image_r4]
 
 
 
167
  gr.on(
168
  triggers=[prompt.submit, run.click],
169
  fn=run_comparison,
 
40
  variant="fp16"
41
  )
42
  RealVisXLv4_pipe.to("cuda")
43
+ ## playground V2.5##
44
+ play_pipe = DiffusionPipeline.from_pretrained(
45
+ "playgroundai/playground-v2.5-1024px-aesthetic",
46
+ torch_dtype=torch.float16,
47
+ vae=vae,
48
+ use_safetensors=True,
49
+ add_watermarker=False,
50
+ variant="fp16"
51
+ )
52
+ play_pipe_pipe.to("cuda")
53
 
54
  @spaces.GPU
55
  def run_comparison(prompt: str,
 
91
  ).images
92
  image_paths_r4 = [save_image(img) for img in image_r4]
93
 
94
+ play_pipe = play_pipe(prompt=prompt,
95
+ negative_prompt=negative_prompt,
96
+ width=width,
97
+ height=height,
98
+ guidance_scale=guidance_scale,
99
+ num_inference_steps=num_inference_steps,
100
+ num_images_per_prompt=num_images_per_prompt,
101
+ cross_attention_kwargs={"scale": 0.65},
102
+ output_type="pil",
103
+ ).images
104
+ image_paths_play_pipe = [save_image(img) for img in image_r4]
105
+ return image_paths_r3, image_paths_r4,image_paths_play_pipe, seed
106
 
107
  examples = ["A dignified beaver wearing glasses, a vest, and colorful neck tie.",
108
  "The spirit of a tamagotchi wandering in the city of Barcelona",
 
184
  with gr.Column():
185
  image_r4 = gr.Gallery(label="RealVisXL V4",columns=1, preview=True,)
186
  gr.Markdown("## [RealVisXL V3](https://huggingface.co)")
187
+ with gr.Column():
188
+ play_pipe = gr.Gallery(label="RealVisXL V4",columns=1, preview=True,)
189
+ gr.Markdown("## [RealVisXL V3](https://huggingface.co)")
190
+ image_outputs = [image_r3, image_r4, play_pipe]
191
  gr.on(
192
  triggers=[prompt.submit, run.click],
193
  fn=run_comparison,