multimodalart HF staff commited on
Commit
fc0daea
1 Parent(s): df2ba13

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -277,7 +277,8 @@ def generate_image(prompt_mash, steps, seed, cfg_scale, width, height, progress)
277
  generator = torch.Generator(device="cuda").manual_seed(seed)
278
  with calculateDuration("Generating image"):
279
  # Generate image
280
- for img in pipe.flux_pipe_call_that_returns_an_iterable_of_images(prompt=prompt_mash,
 
281
  num_inference_steps=steps,
282
  guidance_scale=cfg_scale,
283
  width=width,
@@ -288,6 +289,7 @@ def generate_image(prompt_mash, steps, seed, cfg_scale, width, height, progress)
288
  good_vae=good_vae,
289
  ):
290
  yield img
 
291
 
292
  @spaces.GPU(duration=70)
293
  def generate_image_to_image(prompt_mash, image_input_path, image_strength, steps, cfg_scale, width, height, seed):
@@ -306,6 +308,7 @@ def generate_image_to_image(prompt_mash, image_input_path, image_strength, steps
306
  joint_attention_kwargs={"scale": 1.0},
307
  output_type="pil",
308
  ).images[0]
 
309
  return final_image
310
 
311
  @spaces.GPU(duration=70)
 
277
  generator = torch.Generator(device="cuda").manual_seed(seed)
278
  with calculateDuration("Generating image"):
279
  # Generate image
280
+ for img in pipe.flux_pipe_call_that_returns_an_iterable_of_images(
281
+ prompt=prompt_mash,
282
  num_inference_steps=steps,
283
  guidance_scale=cfg_scale,
284
  width=width,
 
289
  good_vae=good_vae,
290
  ):
291
  yield img
292
+ pipe.to("cpu")
293
 
294
  @spaces.GPU(duration=70)
295
  def generate_image_to_image(prompt_mash, image_input_path, image_strength, steps, cfg_scale, width, height, seed):
 
308
  joint_attention_kwargs={"scale": 1.0},
309
  output_type="pil",
310
  ).images[0]
311
+ pipe_i2i.to("cpu")
312
  return final_image
313
 
314
  @spaces.GPU(duration=70)