-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Is there an existing issue for this?
- I have searched the existing issues
Contact Details
No response
What should this feature add?
4.0 introduced a restrictive API for the invocation context (see #5491). This API does not seem to include a way to get the file path of an image. The image contents are available via context.images.get_pil
and a public url is available via context.images.get_dto
, but the only way to get the local path is by accessing the 'private' context._services.images
class.
Getting the file path of a (compressed) image is useful for example when POSTing an image to a different server, like I do in the Remote Image nodes (https://github.com/fieldOfView/InvokeAI-remote_image).
The most straightforward way to disclose the local path of an image is by adding a get_path
method to the ImagesInterface
class. I can draft a PR for that.
Alternatives
Alternatively, I could
- Use the private
context._services
to get at theimages.get_path
method - Load the PIL image and recompress it (and POST the result)
- GET the file through the API (and POST the result)
Additional Content
No response