google / style-aligned

Official code for "Style Aligned Image Generation via Shared Attention"
Apache License 2.0
1.23k stars 90 forks source link

How can I use stable diffusion2-1? #30

Open LiManyuan663 opened 3 months ago

LiManyuan663 commented 3 months ago

I tried to use stable diffusion2-1,

scheduler = DDIMScheduler(beta_start=0.00085, beta_end=0.012, beta_schedule="scaled_linear", clip_sample=False,
                          set_alpha_to_one=False)
pipeline = StableDiffusionPipeline.from_pretrained(
    "stabilityai/stable-diffusion-2-1",
    revision="fp16",
    scheduler=scheduler
)
pipeline = pipeline.to("cuda")

handler = sa_handler.Handler(pipeline)
sa_args = sa_handler.StyleAlignedArgs(share_group_norm=True,
                                      share_layer_norm=True,
                                      share_attention=True,
                                      adain_queries=True,
                                      adain_keys=True,
                                      adain_values=False,
                                     )

handler.register(sa_args, )

but I got a very strange result, image

I would be appreciate it if you could answer my question

LiManyuan663 commented 3 months ago

I've fixed the above issue by loading 2-1's sheduler, but I still wonder how can I use 2-1 in style_aligned_trasfer? I am looking forword to your answering.