Spaces:
Runtime error
Runtime error
update image-render endpoint
Browse files90 unmodified lines91929394959697981 unmodified line10010110210310410590 unmodified linesimg_size=768,api_name="/on_submit")new_image_path = resultif not os.path.exists(new_image_path):raise HTTPException(status_code=404, detail="Image not found")1 unmodified linewith open(new_image_path, "rb") as img_file:base64_str = base64.b64encode(img_file.read()).decode('utf-8')return JSONResponse(content={"image": base64_str}, status_code=200)except Exception as e:print(str(e))90 unmodified lines9192939495969798991001 unmodified line10210310410510610710890 unmodified linesimg_size=768,api_name="/on_submit")new_image_path = result# delete image_pathos.remove(image_path)if not os.path.exists(new_image_path):raise HTTPException(status_code=404, detail="Image not found")1 unmodified linewith open(new_image_path, "rb") as img_file:base64_str = base64.b64encode(img_file.read()).decode('utf-8')os.remove(new_image_path)return JSONResponse(content={"image": base64_str}, status_code=200)except Exception as e:print(str(e))
app.py+4-1