Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new community pipeline #5477

Commits on Oct 22, 2023

  1. Add a new community pipeline

    examples/community/latent_consistency_img2img.py
    
    which can be called like this
    
    import torch
    from diffusers import DiffusionPipeline
    
    pipe = DiffusionPipeline.from_pretrained(
                    "SimianLuo/LCM_Dreamshaper_v7", custom_pipeline="latent_consistency_txt2img", custom_revision="main")
    
                # To save GPU memory, torch.float16 can be used, but it may compromise image quality.
    pipe.to(torch_device="cuda", torch_dtype=torch.float32)
    
    img2img=LatentConsistencyModelPipeline_img2img(
        vae=pipe.vae,
        text_encoder=pipe.text_encoder,
        tokenizer=pipe.tokenizer,
        unet=pipe.unet,
        #scheduler=pipe.scheduler,
        scheduler=None,
        safety_checker=None,
        feature_extractor=pipe.feature_extractor,
        requires_safety_checker=False,
    )
    
    img = Image.open("thisismyimage.png")
    
    result = img2img(prompt,img,strength,num_inference_steps=4)
    nagolinc committed Oct 22, 2023
    Configuration menu
    Copy the full SHA
    9a08b9b View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2023

  1. Apply suggestions from code review

    Fix name formatting for scheduler
    
    Co-authored-by: Patrick von Platen <patrick.v.platen@gmail.com>
    nagolinc and patrickvonplaten authored Oct 23, 2023
    Configuration menu
    Copy the full SHA
    0ed52c4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    072e682 View commit details
    Browse the repository at this point in the history