Spaces:
Build error
Build error
Update app.py
Browse files
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]*
|
15 |
images = output.images
|
16 |
-
images = [np.array(images[i]) for i in range(
|
17 |
images = np.concatenate([
|
18 |
-
np.concatenate(images[0:
|
19 |
-
np.concatenate(images[
|
20 |
-
|
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
|