tab for switching flow
This commit is contained in:
@@ -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({})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user