Replies: 1 comment 2 replies
-
You need to upload the image/mask files prior to using it in a LoadImage node... There are 2 API endpoints for that: Line 257 in b643eae POST /upload/mask Line 263 in b643eae Here is how this is done in JS in the browser : async function uploadFile(file, updateNode, pasted = false) {
// Wrap file in formdata so it includes filename
const body = new FormData()
body.append('image', file)
if (pasted) body.append('subfolder', 'pasted')
const resp = await api.fetchApi('/upload/image', {
method: 'POST',
body
})
// ...
}
// ...
await uploadFile(fileInput.files[0], true) I don't know how to upload/POST a multipart/formdata in python :/ but this should be the usual way... |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm trying to build an api call for img2img workflow. How would I send the image file to "LoadImage"? I saw that the input image needs to exist in /comfyui/input. How do I write the api call that sends and saves the image in that folder?
Beta Was this translation helpful? Give feedback.
All reactions