Fix overaggressive caching for latents with the same pixel density but different dimensions, minor fix for headless mode #251
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.


Currently TSC_KSampler.sample caches sampler results using a variety of input keys including the hash of the input latent image. However, the key does not include the latent's shape. Back to back generations with empty latents of contrasting portrait/landscape shapes but equal latent pixel counts appear to result in a false positive cache hit if all other parameters are held the same.
Additionally, a guard has been added to calls to globals_cleanup() to ensure a prompt object exists - when using the node headlessly via pydn/ComfyUI-to-Python-Extension calls to globals_cleanup will crash the server. My apologies for bundling these.