Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -32,16 +32,19 @@ grid_wide=10
|
|
32 |
|
33 |
|
34 |
|
35 |
-
def get_concat_h_cut(in1, in2,
|
36 |
print(in1)
|
37 |
print(in2)
|
38 |
im1=Image.open(in1)
|
39 |
im2=Image.open(in2)
|
|
|
|
|
40 |
#im1=in1
|
41 |
#im2=in2
|
42 |
-
dst = Image.new('RGB', (im1.width + im2.width, min(im1.height, im2.height)))
|
43 |
-
dst.
|
44 |
-
dst.paste(
|
|
|
45 |
return dst
|
46 |
|
47 |
|
@@ -120,16 +123,16 @@ def run_dif_color(out_prompt,im_path,model_drop,tint,im_height,im_width):
|
|
120 |
#im_roll.save(f'comb-{uid}-tmp.png')
|
121 |
#for i in range(2,len(out_box)):
|
122 |
#im_roll = get_concat_h_cut(f'comb-{uid}-tmp.png',f'{out_box[cnt]}')
|
123 |
-
im_roll = get_concat_h_cut(f'comb-{uid}-tmp.png',f'tmp-{cnt}-{uid}.png',
|
124 |
-
im_roll.save(f'comb-{uid}-tmp.png')
|
125 |
-
out = f'comb-{uid}-tmp.png'
|
126 |
yield gr.Image(out),out_html
|
127 |
|
128 |
else:
|
129 |
tmp_im = Image.open(out_box[0])
|
130 |
#tmp_im = out_box[0]
|
131 |
-
tmp_im.save(f'comb-{uid}-tmp.png')
|
132 |
-
out = f'comb-{uid}-tmp.png'
|
133 |
yield gr.Image(out),out_html
|
134 |
|
135 |
|
|
|
32 |
|
33 |
|
34 |
|
35 |
+
def get_concat_h_cut(in1, in2, pos_x,pos_y):
|
36 |
print(in1)
|
37 |
print(in2)
|
38 |
im1=Image.open(in1)
|
39 |
im2=Image.open(in2)
|
40 |
+
pos_x=int(pos_x)
|
41 |
+
pos_y=int(pos_y)
|
42 |
#im1=in1
|
43 |
#im2=in2
|
44 |
+
#dst = Image.new('RGB', (im1.width + im2.width, min(im1.height, im2.height)))
|
45 |
+
dst = Image.new('RGB', (im2.width*pos_x, im2.height*pos_y))
|
46 |
+
dst.paste(im1, (0, 0))
|
47 |
+
dst.paste(im2, (im2.width*pos_x, im2.height *pos_y))
|
48 |
return dst
|
49 |
|
50 |
|
|
|
123 |
#im_roll.save(f'comb-{uid}-tmp.png')
|
124 |
#for i in range(2,len(out_box)):
|
125 |
#im_roll = get_concat_h_cut(f'comb-{uid}-tmp.png',f'{out_box[cnt]}')
|
126 |
+
im_roll = get_concat_h_cut(f'comb-{uid}-{hh}-tmp.png',f'tmp-{cnt}-{uid}.png',b,hh)
|
127 |
+
im_roll.save(f'comb-{uid}-{hh}-tmp.png')
|
128 |
+
out = f'comb-{uid}-{hh}-tmp.png'
|
129 |
yield gr.Image(out),out_html
|
130 |
|
131 |
else:
|
132 |
tmp_im = Image.open(out_box[0])
|
133 |
#tmp_im = out_box[0]
|
134 |
+
tmp_im.save(f'comb-{uid}-{hh}-tmp.png')
|
135 |
+
out = f'comb-{uid}-{hh}-tmp.png'
|
136 |
yield gr.Image(out),out_html
|
137 |
|
138 |
|