parent
96c124491e
commit
53f4b3d677
@ -87,12 +87,11 @@ def reactor_api(_: gr.Blocks, app: FastAPI):
|
|||||||
if result_file_path == "":
|
if result_file_path == "":
|
||||||
result_file_path = default_file_path()
|
result_file_path = default_file_path()
|
||||||
try:
|
try:
|
||||||
result.save(result_file_path, format='PNG')
|
result[0].save(result_file_path, format='PNG')
|
||||||
|
logger.info("Result has been saved to: %s", result_file_path)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error("Error while saving result: %s",e)
|
logger.error("Error while saving result: %s",e)
|
||||||
finally:
|
return {"image": api.encode_pil_to_base64(result[0])}
|
||||||
logger.info("Result has been saved to: %s", result_file_path)
|
|
||||||
return {"image": api.encode_pil_to_base64(result)}
|
|
||||||
|
|
||||||
@app.get("/reactor/models")
|
@app.get("/reactor/models")
|
||||||
async def reactor_models():
|
async def reactor_models():
|
||||||
|
|||||||
@ -246,6 +246,8 @@ class FaceSwapScript(scripts.Script):
|
|||||||
self.source_faces_index = [0]
|
self.source_faces_index = [0]
|
||||||
if len(self.faces_index) == 0:
|
if len(self.faces_index) == 0:
|
||||||
self.faces_index = [0]
|
self.faces_index = [0]
|
||||||
|
if self.save_original is None:
|
||||||
|
self.save_original = False
|
||||||
|
|
||||||
if self.source is not None:
|
if self.source is not None:
|
||||||
apply_logging_patch(console_logging_level)
|
apply_logging_patch(console_logging_level)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user