Skip to content

Stable Diffusion x4 upscaler has a different expected value range than other pipelines #3654

@yiyixuxu

Description

@yiyixuxu

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

and postprocess, it will not apply denormalization if we output a pytorch tensor

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions