chywang commited on
Commit
f4e063b
1 Parent(s): 473b807

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -11,13 +11,13 @@ pipe_text2img = LDMZhTextToImagePipeline.from_pretrained(model_id, use_auth_toke
11
  pipe_text2img = pipe_text2img.to(device)
12
 
13
  def infer_text2img(prompt, guide, steps):
14
- output = pipe_text2img([prompt]*9, guidance_scale=guide, num_inference_steps=steps)
15
  images = output.images
16
- images = [np.array(images[i]) for i in range(9)]
17
  images = np.concatenate([
18
- np.concatenate(images[0:3], axis=0),
19
- np.concatenate(images[3:6], axis=0),
20
- np.concatenate(images[6:9], axis=0),
21
  ], axis=1)
22
  images = Image.fromarray(images)
23
  return images
 
11
  pipe_text2img = pipe_text2img.to(device)
12
 
13
  def infer_text2img(prompt, guide, steps):
14
+ output = pipe_text2img([prompt]*4, guidance_scale=guide, num_inference_steps=steps)
15
  images = output.images
16
+ images = [np.array(images[i]) for i in range(4)]
17
  images = np.concatenate([
18
+ np.concatenate(images[0:2], axis=0),
19
+ np.concatenate(images[2:4], axis=0),
20
+ # np.concatenate(images[6:9], axis=0),
21
  ], axis=1)
22
  images = Image.fromarray(images)
23
  return images