Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -109,9 +109,9 @@ def run_dif_color(out_prompt,im_path,model_drop,tint,im_height,im_width):
|
|
109 |
|
110 |
colorize = RGBTransform().mix_with(color,factor=float(tint)).applied_to(raw)
|
111 |
print (colorize)
|
112 |
-
colorize.save(f'tmp-{uid}.png')
|
113 |
#out_box.append(f'tmp-{uid}.png')
|
114 |
-
out_box.append(f'tmp-{uid}.png')
|
115 |
|
116 |
print(f'out_box:: {out_box}')
|
117 |
if out_box:
|
@@ -119,16 +119,18 @@ def run_dif_color(out_prompt,im_path,model_drop,tint,im_height,im_width):
|
|
119 |
#im_roll = get_concat_v_cut(f'{out_box[0]}',f'{out_box[1]}')
|
120 |
#im_roll.save(f'comb-{uid}-tmp.png')
|
121 |
for i in range(2,len(out_box)):
|
122 |
-
|
123 |
-
im_roll = get_concat_h_cut(f'comb-{uid}-tmp.png',f'tmp-{uid}.png')
|
124 |
im_roll.save(f'comb-{uid}-tmp.png')
|
125 |
out = f'comb-{uid}-tmp.png'
|
|
|
|
|
126 |
else:
|
127 |
tmp_im = Image.open(out_box[0])
|
128 |
#tmp_im = out_box[0]
|
129 |
tmp_im.save(f'comb-{uid}-tmp.png')
|
130 |
out = f'comb-{uid}-tmp.png'
|
131 |
-
|
132 |
|
133 |
|
134 |
except Exception as e:
|
|
|
109 |
|
110 |
colorize = RGBTransform().mix_with(color,factor=float(tint)).applied_to(raw)
|
111 |
print (colorize)
|
112 |
+
colorize.save(f'tmp-{cnt}-{uid}.png')
|
113 |
#out_box.append(f'tmp-{uid}.png')
|
114 |
+
out_box.append(f'tmp-{cnt}-{uid}.png')
|
115 |
|
116 |
print(f'out_box:: {out_box}')
|
117 |
if out_box:
|
|
|
119 |
#im_roll = get_concat_v_cut(f'{out_box[0]}',f'{out_box[1]}')
|
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[i]}')
|
123 |
+
#im_roll = get_concat_h_cut(f'comb-{uid}-tmp.png',f'tmp-{uid}.png')
|
124 |
im_roll.save(f'comb-{uid}-tmp.png')
|
125 |
out = f'comb-{uid}-tmp.png'
|
126 |
+
yield 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 out,out_html
|
134 |
|
135 |
|
136 |
except Exception as e:
|