xywwww commited on
Commit
e6efdca
·
verified ·
1 Parent(s): 78b36a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -30,7 +30,7 @@ model.load_state_dict(load_state_dict(ckpt), strict=False)
30
  model = model.cuda()
31
  ddim_sampler = DDIMSampler(model)
32
 
33
-
34
  def process(input_image, prompt, a_prompt, n_prompt, num_samples, image_resolution, ddim_steps, guess_mode, strength, scale, seed, eta, low_threshold, high_threshold):
35
  with torch.no_grad():
36
  img = resize_image(HWC3(input_image), image_resolution)
@@ -74,7 +74,7 @@ def process(input_image, prompt, a_prompt, n_prompt, num_samples, image_resoluti
74
  x_samples = (einops.rearrange(x_samples, 'b c h w -> b h w c') * 127.5 + 127.5).cpu().numpy().clip(0, 255).astype(np.uint8)
75
 
76
  results = [x_samples[i] for i in range(num_samples)]
77
- return [255 - img] + results
78
 
79
 
80
  block = gr.Blocks().queue()
 
30
  model = model.cuda()
31
  ddim_sampler = DDIMSampler(model)
32
 
33
34
  def process(input_image, prompt, a_prompt, n_prompt, num_samples, image_resolution, ddim_steps, guess_mode, strength, scale, seed, eta, low_threshold, high_threshold):
35
  with torch.no_grad():
36
  img = resize_image(HWC3(input_image), image_resolution)
 
74
  x_samples = (einops.rearrange(x_samples, 'b c h w -> b h w c') * 127.5 + 127.5).cpu().numpy().clip(0, 255).astype(np.uint8)
75
 
76
  results = [x_samples[i] for i in range(num_samples)]
77
+ return results
78
 
79
 
80
  block = gr.Blocks().queue()