lllyasviel/LayerDiffuse

Another nice integration with Hugging Face Diffusers

jnkl314 opened this issue · 0 comments

Github -> https://github.com/jnkl314/diffusers_LayerDiffuse

It integrates better with Diffusers by hiding away the implementation in a new pipeline class StableDiffusionXLLayerDiffusePipeline.

Generating a transparent image is now as easy as using any other Diffusers pipeline.

Usage snippet

import torch
from diffusers_extension.pipeline_stable_diffusion_xl_layer_diffuse import StableDiffusionXLLayerDiffusePipeline

pipeline = StableDiffusionXLLayerDiffusePipeline.from_pretrained(
    "stabilityai/stable-diffusion-xl-base-1.0",
    torch_dtype=torch.float16,
    variant="fp16",
).to("cuda")

images = pipeline(
    prompt="portrait of woman in suit with messy hair, high resolution, photorealistic, uniform textureless background",
    negative_prompt="ugly, bad, shadow, artifact, blurry",
    num_inference_steps=20,
    width=1024,
    height=1024,
    generator=torch.Generator(device="cuda").manual_seed(42)
).images

images[0].save("sdxl_layerdiffuse_result.png")

Overview
image