Manjushri commited on
Commit
f5eed48
1 Parent(s): 31adc55

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -13,7 +13,9 @@ 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
-
 
 
17
  torch.cuda.empty_cache()
18
  image=SD3(
19
  prompt=Prompt,
@@ -38,7 +40,7 @@ def genie (Model, Prompt, negative_prompt, height, width, scale, steps, seed):
38
  pipe.enable_xformers_memory_efficient_attention()
39
  pipe = pipe.to(device)
40
  torch.cuda.empty_cache()
41
- image = pipe(Prompt, negative_prompt=negative_prompt, image=int_image, denoising_start=high_noise_frac).images[0]
42
  torch.cuda.empty_cache()
43
 
44
  return image
 
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()
20
  image=SD3(
21
  prompt=Prompt,
 
40
  pipe.enable_xformers_memory_efficient_attention()
41
  pipe = pipe.to(device)
42
  torch.cuda.empty_cache()
43
+ image = pipe(Prompt, negative_prompt=negative_prompt, image=int_image, denoising_start=.99).images[0]
44
  torch.cuda.empty_cache()
45
 
46
  return image