-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Description
for input/output in pt
format, StableDiffusionUpscalePipeline
expect the input to have value range [-1,1]
and also output [-1,1]
see preprocess
method here, i.e. It will not apply normalization if the input is a pytorch tensor
diffusers/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_upscale.py
Line 37 in 94a0c64
if isinstance(image, torch.Tensor): |
and postprocess
, it will not apply denormalization if we output a pytorch tensor
diffusers/src/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_upscale.py
Line 735 in 94a0c64
elif output_type == "pt": |
A little bit of context is that for all the pipelines that we've refactored with VaeImageProcessor
, we now expect all input and outputs to be in [0,1]
value range. And, previously before the refactoring, all the pipelines expect pytorch tensor input to be in [-1,1]
but output in [0,1]
- this inconsistency is one of the reasons we started to create this class to unify the image processing API.
Since we want to be able to chain the pipelines, we would want to have consistent value ranges among all the pipelines no? that way we can pass the PyTorch tensor output from one pipeline to another seamlessly.
Also I found this commit that made the x4 upscaler to output pytorch tensors in [-1,1]
@patrickvonplaten
da2ce1a