Manjushri commited on
Commit
d5159b8
1 Parent(s): 903c633

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -13,7 +13,7 @@ torch.cuda.empty_cache()
13
  def genie (Model, Prompt, negative_prompt, height, width, scale, steps, seed):
14
  generator = np.random.seed(0) if seed == 0 else torch.manual_seed(seed)
15
  if Model == "SD3":
16
- torch.cuda.max_memory_allocated(device=device)
17
  torch.cuda.empty_cache()
18
  SD3 = StableDiffusion3Pipeline.from_pretrained("stabilityai/stable-diffusion-3-medium-diffusers", torch_dtype=torch.float16).to(device)
19
  torch.cuda.empty_cache()
@@ -28,13 +28,13 @@ def genie (Model, Prompt, negative_prompt, height, width, scale, steps, seed):
28
  if Model == "FXL":
29
 
30
  torch.cuda.empty_cache()
31
- torch.cuda.max_memory_allocated(device=device)
32
  pipe = DiffusionPipeline.from_pretrained("circulus/canvers-fusionXL-v1", torch_dtype=torch.float16)
33
  pipe.enable_xformers_memory_efficient_attention()
34
  pipe = pipe.to(device)
35
  torch.cuda.empty_cache()
36
 
37
- torch.cuda.max_memory_allocated(device=device)
38
  int_image = pipe(Prompt, negative_prompt=negative_prompt, height=height, width=width, num_inference_steps=steps, guidance_scale=scale, output_type="latent").images
39
  pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-1.0", use_safetensors=True, torch_dtype=torch.float16, variant="fp16") if torch.cuda.is_available() else DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-1.0")
40
  pipe.enable_xformers_memory_efficient_attention()
 
13
  def genie (Model, Prompt, negative_prompt, height, width, scale, steps, seed):
14
  generator = np.random.seed(0) if seed == 0 else torch.manual_seed(seed)
15
  if Model == "SD3":
16
+ #torch.cuda.max_memory_allocated(device=device)
17
  torch.cuda.empty_cache()
18
  SD3 = StableDiffusion3Pipeline.from_pretrained("stabilityai/stable-diffusion-3-medium-diffusers", torch_dtype=torch.float16).to(device)
19
  torch.cuda.empty_cache()
 
28
  if Model == "FXL":
29
 
30
  torch.cuda.empty_cache()
31
+ #torch.cuda.max_memory_allocated(device=device)
32
  pipe = DiffusionPipeline.from_pretrained("circulus/canvers-fusionXL-v1", torch_dtype=torch.float16)
33
  pipe.enable_xformers_memory_efficient_attention()
34
  pipe = pipe.to(device)
35
  torch.cuda.empty_cache()
36
 
37
+ #torch.cuda.max_memory_allocated(device=device)
38
  int_image = pipe(Prompt, negative_prompt=negative_prompt, height=height, width=width, num_inference_steps=steps, guidance_scale=scale, output_type="latent").images
39
  pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-1.0", use_safetensors=True, torch_dtype=torch.float16, variant="fp16") if torch.cuda.is_available() else DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-1.0")
40
  pipe.enable_xformers_memory_efficient_attention()