Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ from PIL import Image
|
|
7 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
8 |
model_id = "alibaba-pai/pai-diffusion-poem-large-zh"
|
9 |
|
10 |
-
pipe_text2img = LDMZhTextToImagePipeline.from_pretrained(model_id
|
11 |
pipe_text2img = pipe_text2img.to(device)
|
12 |
|
13 |
def infer_text2img(prompt, guide, steps):
|
@@ -17,7 +17,6 @@ def infer_text2img(prompt, guide, steps):
|
|
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
|
@@ -29,7 +28,7 @@ with gr.Blocks() as demo:
|
|
29 |
["接天莲叶无穷碧 映日荷花别样红"],
|
30 |
]
|
31 |
with gr.Row():
|
32 |
-
with gr.Column(scale=
|
33 |
image_out = gr.Image(label = '输出(output)')
|
34 |
with gr.Column(scale=1, ):
|
35 |
prompt = gr.Textbox(label = '提示词(prompt)')
|
|
|
7 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
8 |
model_id = "alibaba-pai/pai-diffusion-poem-large-zh"
|
9 |
|
10 |
+
pipe_text2img = LDMZhTextToImagePipeline.from_pretrained(model_id)
|
11 |
pipe_text2img = pipe_text2img.to(device)
|
12 |
|
13 |
def infer_text2img(prompt, guide, steps):
|
|
|
17 |
images = np.concatenate([
|
18 |
np.concatenate(images[0:2], axis=0),
|
19 |
np.concatenate(images[2:4], axis=0),
|
|
|
20 |
], axis=1)
|
21 |
images = Image.fromarray(images)
|
22 |
return images
|
|
|
28 |
["接天莲叶无穷碧 映日荷花别样红"],
|
29 |
]
|
30 |
with gr.Row():
|
31 |
+
with gr.Column(scale=0.5, ):
|
32 |
image_out = gr.Image(label = '输出(output)')
|
33 |
with gr.Column(scale=1, ):
|
34 |
prompt = gr.Textbox(label = '提示词(prompt)')
|