support PIL Image objects in image conditioning functions#124
Open
Fredy Rivera (FredyRivera-dev) wants to merge 1 commit intoLightricks:mainfrom
Open
support PIL Image objects in image conditioning functions#124Fredy Rivera (FredyRivera-dev) wants to merge 1 commit intoLightricks:mainfrom
Fredy Rivera (FredyRivera-dev) wants to merge 1 commit intoLightricks:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PIL.Imageobject support in image conditioningDescription
Adds compatibility with
PIL.Imageobjects in the image conditioning functions, allowing in-memory images to be passed directly instead of requiring a path on disk.Previously, the conditioning functions only accepted a
strwith the image path, forcing integrators to save the image to disk before using it. This is impractical in programmatic use cases where the image is already available in memory, for example when coming from an API, a byte stream, or a pipeline that generates images on the fly.Changes
ltx_pipelines/utils/media_io.pyload_image_conditioning: theimage_pathparameter now acceptsUnion[str, Image.Image]. If a PIL object is received, the newdecode_image_pilis called; otherwise the original flow withdecode_imageis preserved.decode_image_pil(image: Image.Image) -> np.ndarray, which converts the PIL object directly to a NumPy array without reading from disk.ltx_pipelines/utils/helpers.pyimage_conditionings_by_replacing_latent:imagesparameter type updated tolist[tuple[Union[str, Image.Image], int, float]].image_conditionings_by_adding_guiding_latent: same type change inimages.ltx_pipelines/ti2vid_two_stages.pyTI2VidTwoStagesPipeline:imagesparameter type updated tolist[tuple[Union[str, Image.Image], int, float]].Compatibility
All changes are fully backwards compatible. Any existing code passing paths as
strcontinues to work without modifications.