Manjushri commited on
Commit
4f01bf2
·
verified ·
1 Parent(s): 39c5f37

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -46,7 +46,10 @@ def genie (Model, Prompt, negative_prompt, height, width, scale, steps, seed):
46
  torch_dtype = torch.float32
47
 
48
  pipe = DiffusionPipeline.from_pretrained(model_repo_id, torch_dtype=torch_dtype)
49
- pipe = pipe.to(device)
 
 
 
50
  torch.cuda.empty_cache()
51
  image = pipe(prompt=Prompt, negative_prompt=negative_prompt, guidance_scale=0.0, num_inference_steps=4, width=1024, height=1024, generator=generator,).images[0]
52
  torch.cuda.empty_cache()
 
46
  torch_dtype = torch.float32
47
 
48
  pipe = DiffusionPipeline.from_pretrained(model_repo_id, torch_dtype=torch_dtype)
49
+ #pipe = pipe.to(device)
50
+ pipe.enable_model_cpu_offload()
51
+ pipe.vae.enable_slicing()
52
+ pipe.vae.enable_tiling()
53
  torch.cuda.empty_cache()
54
  image = pipe(prompt=Prompt, negative_prompt=negative_prompt, guidance_scale=0.0, num_inference_steps=4, width=1024, height=1024, generator=generator,).images[0]
55
  torch.cuda.empty_cache()