yiren98 commited on
Commit
2c2d2a7
·
1 Parent(s): 661a2b2
Files changed (1) hide show
  1. gradio_app_asy.py +11 -5
gradio_app_asy.py CHANGED
@@ -117,7 +117,7 @@ def infer(prompt, frame, seed=0):
117
 
118
  logger.info(f"Using seed: {seed}")
119
 
120
- # ae.to("cpu")
121
  clip_l.to(device)
122
  t5xxl.to(device)
123
 
@@ -151,8 +151,8 @@ def infer(prompt, frame, seed=0):
151
  args = lambda: None
152
  args.frame_num = frame_num
153
 
154
- # clip_l.to("cpu")
155
- # t5xxl.to("cpu")
156
 
157
  model.to(device)
158
 
@@ -182,12 +182,12 @@ def infer(prompt, frame, seed=0):
182
  # Decode the final image
183
  x = x.float()
184
  x = flux_utils.unpack_latents(x, packed_latent_height, packed_latent_width)
185
- # model.to("cpu")
186
  ae.to(device)
187
  with accelerator.autocast(), torch.no_grad():
188
  x = ae.decode(x)
189
  logger.debug("Latents decoded into image.")
190
- # ae.to("cpu")
191
 
192
  # Convert the tensor to an image
193
  x = x.clamp(-1, 1)
@@ -270,6 +270,12 @@ with gr.Blocks() as demo:
270
  "sks6, 3*3 puzzle of 9 sub-images, step-by-step portrait painting process, woman with blonde curly hair",
271
  1062070717
272
  ],
 
 
 
 
 
 
273
  ]
274
 
275
  gr.Examples(
 
117
 
118
  logger.info(f"Using seed: {seed}")
119
 
120
+ ae.to("cpu")
121
  clip_l.to(device)
122
  t5xxl.to(device)
123
 
 
151
  args = lambda: None
152
  args.frame_num = frame_num
153
 
154
+ clip_l.to("cpu")
155
+ t5xxl.to("cpu")
156
 
157
  model.to(device)
158
 
 
182
  # Decode the final image
183
  x = x.float()
184
  x = flux_utils.unpack_latents(x, packed_latent_height, packed_latent_width)
185
+ model.to("cpu")
186
  ae.to(device)
187
  with accelerator.autocast(), torch.no_grad():
188
  x = ae.decode(x)
189
  logger.debug("Latents decoded into image.")
190
+ ae.to("cpu")
191
 
192
  # Convert the tensor to an image
193
  x = x.clamp(-1, 1)
 
270
  "sks6, 3*3 puzzle of 9 sub-images, step-by-step portrait painting process, woman with blonde curly hair",
271
  1062070717
272
  ],
273
+ [
274
+ "9 frame",
275
+ "Sand art",
276
+ "sks8, 3*3 puzzle of 9 sub-images, step-by-step description of sand art creation, <image-1>: The outline of a classic pirate ship is drawn, capturing its sails and hull. <image-2>: Basic shapes of the ship’s structure and masts are added, defining its adventurous form. <image-3>: Details of the sails and rigging begin to appear, adding complexity. <image-4>: Shadows and highlights enhance the ship’s three-dimensional appearance. <image-5>: The ship’s deck and cannons are refined, giving it character. <image-6>: Additional elements like waves and seagulls are added for movement. <image-7>: A backdrop of a stormy sea with dark clouds is introduced, adding drama. <image-8>: Further details like lightning and crashing waves are sketched for intensity. <image-9>: Final touches include vibrant blues and grays, completing the thrilling pirate ship scene.",
277
+ 641262478
278
+ ],
279
  ]
280
 
281
  gr.Examples(