tab for switching flow

This commit is contained in:
San
2023-11-15 17:12:48 +08:00
parent 9f393c7c80
commit e408ac2dbe
+9 -4
View File
@@ -146,14 +146,19 @@ async def get_webhook(request):
@server.PromptServer.instance.routes.post("/input_file")
async def post_input_file(request):
post = await request.read()
post = await request.json()
image_url = post.get("image_url")
output_dir = os.path.join(folder_paths.base_path, "input")
input_dir = os.path.join(folder_paths.base_path, "input")
os.makedirs(output_dir, exist_ok=True)
filename = os.path.join(output_dir, "imagefromai.png")
filename = os.path.join(input_dir, "imagefromai.png")
response = requests.get(image_url)
response.raise_for_status()
with open(filename, "wb") as f:
f.write(post)
f.write(response.content) # Save the image from the URL to the output directory
return web.json_response({})