lnyan commited on
Commit
444252b
1 Parent(s): 327c935

Enable model

Browse files
Files changed (1) hide show
  1. app.py +18 -18
app.py CHANGED
@@ -126,22 +126,22 @@ def run_outpaint(
126
  state,
127
  ):
128
  base64_str = "base64"
129
- data = base64.b64decode(str(sel_buffer_str))
130
- pil = Image.open(io.BytesIO(data))
131
- sel_buffer = np.array(pil)
132
- sel_buffer[:, :, 3]=255
133
- sel_buffer[:, :, 0]=255
134
- out_pil = Image.fromarray(sel_buffer)
135
- out_buffer = io.BytesIO()
136
- out_pil.save(out_buffer, format="PNG")
137
- out_buffer.seek(0)
138
- base64_bytes = base64.b64encode(out_buffer.read())
139
- base64_str = base64_bytes.decode("ascii")
140
- return (
141
- gr.update(label=str(state + 1), value=base64_str,),
142
- gr.update(label="Prompt"),
143
- state + 1,
144
- )
145
  if True:
146
  text2img, inpaint = get_model()
147
  if enable_safety:
@@ -224,8 +224,8 @@ proceed_button_js = load_js("proceed")
224
  mode_js = load_js("mode")
225
  setup_button_js = load_js("setup")
226
 
227
- def get_model(x):
228
- pass
229
  get_model(get_token())
230
 
231
  with blocks as demo:
 
126
  state,
127
  ):
128
  base64_str = "base64"
129
+ # data = base64.b64decode(str(sel_buffer_str))
130
+ # pil = Image.open(io.BytesIO(data))
131
+ # sel_buffer = np.array(pil)
132
+ # sel_buffer[:, :, 3]=255
133
+ # sel_buffer[:, :, 0]=255
134
+ # out_pil = Image.fromarray(sel_buffer)
135
+ # out_buffer = io.BytesIO()
136
+ # out_pil.save(out_buffer, format="PNG")
137
+ # out_buffer.seek(0)
138
+ # base64_bytes = base64.b64encode(out_buffer.read())
139
+ # base64_str = base64_bytes.decode("ascii")
140
+ # return (
141
+ # gr.update(label=str(state + 1), value=base64_str,),
142
+ # gr.update(label="Prompt"),
143
+ # state + 1,
144
+ # )
145
  if True:
146
  text2img, inpaint = get_model()
147
  if enable_safety:
 
224
  mode_js = load_js("mode")
225
  setup_button_js = load_js("setup")
226
 
227
+ # def get_model(x):
228
+ # pass
229
  get_model(get_token())
230
 
231
  with blocks as demo: