oimoyu commited on
Commit
e66de1c
·
verified ·
1 Parent(s): aea7cfb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -11
app.py CHANGED
@@ -39,8 +39,8 @@ def infer(prompt_input, negative_prompt_input, seed, width, height, guidance_sca
39
 
40
  with torch.inference_mode():
41
  consume_time_list.append(time.time() - start_time - sum(consume_time_list))
42
- # sample_width, sample_height = clamp_size(width, height)
43
- sample_width, sample_height = width, height
44
  emptylatentimage_5 = emptylatentimage.generate(
45
  width=sample_width, height=sample_height, batch_size=1
46
  )
@@ -118,15 +118,15 @@ def infer(prompt_input, negative_prompt_input, seed, width, height, guidance_sca
118
  consume_time_list.append(time.time() - start_time - sum(consume_time_list))
119
 
120
 
121
- if width <= 1024 and height <= 1024:
122
- image_tensor = get_value_at_index(ksampler_efficient_23, 5)[0]
123
- image_tensor = torch.clamp(image_tensor * 255.0, 0, 255) # calc to 255 on gpu
124
- image_uint8 = image_tensor.cpu().numpy().astype(np.uint8)
125
- # pillow_img = Image.fromarray(image_uint8)
126
- consume_time_list.append(time.time() - start_time - sum(consume_time_list))
127
- consume_time = time.time() - start_time
128
- print(f"[{datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] consume:{consume_time:.1f}s ({[f'{t:.1f}' for t in consume_time_list]})")
129
- return image_uint8
130
 
131
 
132
  imagescaleby_17 = imagescaleby.upscale(
 
39
 
40
  with torch.inference_mode():
41
  consume_time_list.append(time.time() - start_time - sum(consume_time_list))
42
+ sample_width, sample_height = clamp_size(width, height)
43
+ # sample_width, sample_height = width, height
44
  emptylatentimage_5 = emptylatentimage.generate(
45
  width=sample_width, height=sample_height, batch_size=1
46
  )
 
118
  consume_time_list.append(time.time() - start_time - sum(consume_time_list))
119
 
120
 
121
+ # if width <= 1024 and height <= 1024:
122
+ # image_tensor = get_value_at_index(ksampler_efficient_23, 5)[0]
123
+ # image_tensor = torch.clamp(image_tensor * 255.0, 0, 255) # calc to 255 on gpu
124
+ # image_uint8 = image_tensor.cpu().numpy().astype(np.uint8)
125
+ # # pillow_img = Image.fromarray(image_uint8)
126
+ # consume_time_list.append(time.time() - start_time - sum(consume_time_list))
127
+ # consume_time = time.time() - start_time
128
+ # print(f"[{datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] consume:{consume_time:.1f}s ({[f'{t:.1f}' for t in consume_time_list]})")
129
+ # return image_uint8
130
 
131
 
132
  imagescaleby_17 = imagescaleby.upscale(