Spaces:
Build error
Build error
update bug
Browse files69 unmodified lines70717273747576777879807 unmodified lines8889909192939452 unmodified lines14714814915015115215315415515669 unmodified linesresponse = requests.post(t2i_url,headers=headers,data={'AlgoType': 1,'ReqJson': req_json,'AuthInfo': authInfo})logger.info(f"header: {response.headers}")if response.status_code != 200:7 unmodified linesbinary_data = binary_data1[0]#logger.info(f"binary_data: {binary_data}")image = Image.open(io.BytesIO(base64.b64decode(binary_data)))#image.save('./t2i_image.png')image = image.resize((self.cfg['resolution'], self.cfg['resolution']))return image, True52 unmodified lines"resolution": 611}model_t2i = SeedT2ICaller(cfg_t2i)model_t2i.generate("a beautiful girl")image_path = "./t2i_image.png"with open(image_path, 'rb') as image:image_bytes = image.read()model_edit = SeedEditCaller(cfg_t2i)model_edit.edit(image=image_bytes,edit="please edit to a good man")69 unmodified lines70717273747576777879807 unmodified lines88899091929352 unmodified lines14614714814915015169 unmodified linesresponse = requests.post(t2i_url,headers=headers,data=json.dumps({'AlgoType': 1,'ReqJson': req_json,'AuthInfo': authInfo}))logger.info(f"header: {response.headers}")if response.status_code != 200:7 unmodified linesbinary_data = binary_data1[0]#logger.info(f"binary_data: {binary_data}")image = Image.open(io.BytesIO(base64.b64decode(binary_data)))image = image.resize((self.cfg['resolution'], self.cfg['resolution']))return image, True52 unmodified lines"resolution": 611}model_t2i = SeedT2ICaller(cfg_t2i)image, _ = model_t2i.generate("a beautiful girl")model_edit = SeedEditCaller(cfg_t2i)model_edit.edit(image, edit="please edit to a good man")
caller.py+5-10