Skip to content

Cascade w/ new varnames produces funky images. #7266

@Beinsezii

Description

@Beinsezii

Describe the bug

Using Stable Cascade with the diffusers main branch and the HF PRs 2/44 as intended, it appears as though there's some misconfiguration that results in super funky images as shown.

Old Cascade branch before the variable renaming, using the current main Cascade revisions
00021

Diffusers master branch w/ the updated Cascade revision PRs
cascade_repro

Reproduction

import torch
from math import ceil
from diffusers import (
    StableCascadeCombinedPipeline,
    StableCascadeDecoderPipeline,
    StableCascadePriorPipeline,
)

torch.set_grad_enabled(False)

prior = StableCascadePriorPipeline.from_pretrained("stabilityai/stable-cascade-prior", revision="refs/pr/2", torch_dtype=torch.bfloat16)
decoder = StableCascadeDecoderPipeline.from_pretrained("stabilityai/stable-cascade", revision="refs/pr/44", torch_dtype=torch.bfloat16)
pipe = StableCascadeCombinedPipeline(
    decoder.tokenizer,
    decoder.text_encoder,
    decoder.decoder,
    decoder.scheduler,
    decoder.vqgan,
    prior.prior,
    prior.text_encoder,
    prior.tokenizer,
    prior.scheduler,
    prior.feature_extractor,
    prior.image_encoder,
)

del prior, decoder
pipe = pipe.to("cuda")

# CPU noise for cross-machine reproducibility
size = [
    1,
    pipe.prior_pipe.prior.config.in_channels,
    ceil(1024 / pipe.prior_pipe.config.resolution_multiple),
    ceil(1024 / pipe.prior_pipe.config.resolution_multiple),
]
generator = torch.Generator("cpu").manual_seed(-2060472805)
latent_input = torch.randn(size, generator=generator, dtype=torch.float32, device="cpu").to(torch.bfloat16)

pipe(
    prompt="photorealistic portrait artwork of an floral robot with a dark night cyberpunk city background",
    negative_prompt="",
    num_inference_steps=50,
    prior_num_inference_steps=50,
    prior_guidance_scale=3.0,
    latents=latent_input,
    generator=generator,
    width=1024,
    height=1024,
).images[0].save("/tmp/cascade_repro.png")

Logs

No response

System Info

Diffusers master, torch 2.3.0+ROCm-6.0

Who can help?

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions