arthur-qiu commited on
Commit
0a9f009
1 Parent(s): 24519bd
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -9,7 +9,7 @@ from pipeline_freescale import StableDiffusionXLPipeline
9
  from free_lunch_utils import register_free_upblock2d, register_free_crossattn_upblock2d
10
 
11
  @spaces.GPU(duration=120)
12
- def infer_gpu_part(pipe, prompt, negative_prompt, ddim_steps, guidance_scale, resolutions_list, fast_mode, cosine_scale, disable_freeu):
13
  pipe = pipe.to("cuda")
14
  generator = torch.Generator(device='cuda')
15
  generator = generator.manual_seed(seed)
@@ -46,7 +46,7 @@ def infer(prompt, output_size, ddim_steps, guidance_scale, cosine_scale, seed, o
46
  pipe = StableDiffusionXLPipeline.from_pretrained(model_ckpt, torch_dtype=torch.float16)
47
 
48
  print('GPU starts')
49
- result = infer_gpu_part(pipe, prompt, negative_prompt, ddim_steps, guidance_scale, resolutions_list, fast_mode, cosine_scale, disable_freeu)
50
  print('GPU ends')
51
 
52
  image = result.images[0]
 
9
  from free_lunch_utils import register_free_upblock2d, register_free_crossattn_upblock2d
10
 
11
  @spaces.GPU(duration=120)
12
+ def infer_gpu_part(pipe, seed, prompt, negative_prompt, ddim_steps, guidance_scale, resolutions_list, fast_mode, cosine_scale, disable_freeu):
13
  pipe = pipe.to("cuda")
14
  generator = torch.Generator(device='cuda')
15
  generator = generator.manual_seed(seed)
 
46
  pipe = StableDiffusionXLPipeline.from_pretrained(model_ckpt, torch_dtype=torch.float16)
47
 
48
  print('GPU starts')
49
+ result = infer_gpu_part(pipe, seed, prompt, negative_prompt, ddim_steps, guidance_scale, resolutions_list, fast_mode, cosine_scale, disable_freeu)
50
  print('GPU ends')
51
 
52
  image = result.images[0]