Skip to content

The first image generated with LMSScheduler is completely green #454

@allo-

Description

@allo-

Describe the bug

The first image generated with LMSScheduler is just a green image.

Reproduction

Run with:

lms = LMSDiscreteScheduler(beta_start=0.00085, beta_end=0.012, beta_schedule="scaled_linear"
pipe = StableDiffusionPipeline.from_pretrained(..., scheduler=lms)

instead of using the default scheduler. Then the first image is completely green. The workaround I am using is to run one step before the actual diffuse function:

if isinstance(pipe.scheduler, LMSDiscreteScheduler):
    # Prevent an empty first frame
    with autocast("cuda"):
        image = diffuse(pipe, text_embeddings, init1, 1, settings["guidance_scale"], eta)

Afterward I compute images similarly, but using e.g. 50 steps instead of one and everything is fine. The default scheduler also seems to work. I did not test other schedulers yet.

System Info

Diffusers from git, python 3.10.6, CUDA with a RTX 3060 card

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleIssues that haven't received updates

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions