Omnibus commited on
Commit
d03da32
·
verified ·
1 Parent(s): a9823a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -49,10 +49,10 @@ def get_concat_h_cut(in1, in2):
49
  def get_concat_v_cut(in1, in2):
50
  print(in1)
51
  print(in2)
52
- #im1=Image.open(in1)
53
- #im2=Image.open(in2)
54
- im1=in1
55
- im2=in2
56
  dst = Image.new(
57
  'RGB', (min(im1.width, im2.width), im1.height + im2.height))
58
  dst.paste(im1, (0, 0))
@@ -71,7 +71,6 @@ def load_model(model_drop):
71
 
72
 
73
  def run_dif_color(out_prompt,im_path,model_drop,tint,im_height,im_width):
74
- uid=uuid.uuid4()
75
  p_seed=""
76
  out_box=[]
77
  out_html=""
@@ -81,6 +80,7 @@ def run_dif_color(out_prompt,im_path,model_drop,tint,im_height,im_width):
81
  cnt = 0
82
  for hh in range(int(im_height/grid_wide)):
83
  for b in range(int(im_width/grid_wide)):
 
84
 
85
  print(f'root::{im_path.root[cnt]}')
86
  #print(f'ea:: {ea}')
@@ -107,8 +107,8 @@ def run_dif_color(out_prompt,im_path,model_drop,tint,im_height,im_width):
107
  raw=raw.convert('RGB')
108
 
109
  colorize = RGBTransform().mix_with(color,factor=float(tint)).applied_to(raw)
110
-
111
- out_box.append(colorize)
112
  if out_box:
113
  if len(out_box)>1:
114
  im_roll = get_concat_v_cut(f'{out_box[0]}',f'{out_box[1]}')
 
49
  def get_concat_v_cut(in1, in2):
50
  print(in1)
51
  print(in2)
52
+ im1=Image.open(in1)
53
+ im2=Image.open(in2)
54
+ #im1=in1
55
+ #im2=in2
56
  dst = Image.new(
57
  'RGB', (min(im1.width, im2.width), im1.height + im2.height))
58
  dst.paste(im1, (0, 0))
 
71
 
72
 
73
  def run_dif_color(out_prompt,im_path,model_drop,tint,im_height,im_width):
 
74
  p_seed=""
75
  out_box=[]
76
  out_html=""
 
80
  cnt = 0
81
  for hh in range(int(im_height/grid_wide)):
82
  for b in range(int(im_width/grid_wide)):
83
+ uid=uuid.uuid4()
84
 
85
  print(f'root::{im_path.root[cnt]}')
86
  #print(f'ea:: {ea}')
 
107
  raw=raw.convert('RGB')
108
 
109
  colorize = RGBTransform().mix_with(color,factor=float(tint)).applied_to(raw)
110
+ colorize.save(f'tmp-{uid}.png')
111
+ out_box.append(f'tmp-{uid}.png')
112
  if out_box:
113
  if len(out_box)>1:
114
  im_roll = get_concat_v_cut(f'{out_box[0]}',f'{out_box[1]}')