Commit 
							
							·
						
						ac7275a
	
1
								Parent(s):
							
							597ad97
								
Update README.md
Browse files
    	
        README.md
    CHANGED
    
    | @@ -8,7 +8,7 @@ license: openrail++ | |
| 8 | 
             
            inference: false
         | 
| 9 | 
             
            ---
         | 
| 10 |  | 
| 11 | 
            -
            # Latent Consistency Model (LCM) LoRA:  | 
| 12 |  | 
| 13 | 
             
            Latent Consistency Model (LCM) LoRA was proposed in [LCM-LoRA: A universal Stable-Diffusion Acceleration Module](TODO:) 
         | 
| 14 | 
             
            by *Simian Luo, Yiqin Tan, Suraj Patil, Daniel Gu et al.*
         | 
| @@ -35,15 +35,15 @@ pip install --upgrade diffusers transformers accelerate peft | |
| 35 |  | 
| 36 | 
             
            ### Text-to-Image
         | 
| 37 |  | 
| 38 | 
            -
            The adapter can be loaded with it's base model ` | 
| 39 | 
             
            Please make sure to either disable `guidance_scale` or use values between 1.0 and 2.0.
         | 
| 40 |  | 
| 41 | 
             
            ```python
         | 
| 42 | 
             
            import torch
         | 
| 43 | 
             
            from diffusers import LCMScheduler, AutoPipelineForText2Image
         | 
| 44 |  | 
| 45 | 
            -
            model_id = " | 
| 46 | 
            -
            adapter_id = "latent-consistency/lcm-lora- | 
| 47 |  | 
| 48 | 
             
            pipe = AutoPipelineForText2Image.from_pretrained(model_id, torch_dtype=torch.float16, variant="fp16")
         | 
| 49 | 
             
            pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)
         | 
|  | |
| 8 | 
             
            inference: false
         | 
| 9 | 
             
            ---
         | 
| 10 |  | 
| 11 | 
            +
            # Latent Consistency Model (LCM) LoRA: SDv1-5
         | 
| 12 |  | 
| 13 | 
             
            Latent Consistency Model (LCM) LoRA was proposed in [LCM-LoRA: A universal Stable-Diffusion Acceleration Module](TODO:) 
         | 
| 14 | 
             
            by *Simian Luo, Yiqin Tan, Suraj Patil, Daniel Gu et al.*
         | 
|  | |
| 35 |  | 
| 36 | 
             
            ### Text-to-Image
         | 
| 37 |  | 
| 38 | 
            +
            The adapter can be loaded with it's base model `runwayml/stable-diffusion-v1-5`. Next, the scheduler needs to be changed to [`LCMScheduler`](https://huggingface.co/docs/diffusers/v0.22.3/en/api/schedulers/lcm#diffusers.LCMScheduler) and we can reduce the number of inference steps to just 2 to 8 steps.
         | 
| 39 | 
             
            Please make sure to either disable `guidance_scale` or use values between 1.0 and 2.0.
         | 
| 40 |  | 
| 41 | 
             
            ```python
         | 
| 42 | 
             
            import torch
         | 
| 43 | 
             
            from diffusers import LCMScheduler, AutoPipelineForText2Image
         | 
| 44 |  | 
| 45 | 
            +
            model_id = "runwayml/stable-diffusion-v1-5"
         | 
| 46 | 
            +
            adapter_id = "latent-consistency/lcm-lora-sdv1-5"
         | 
| 47 |  | 
| 48 | 
             
            pipe = AutoPipelineForText2Image.from_pretrained(model_id, torch_dtype=torch.float16, variant="fp16")
         | 
| 49 | 
             
            pipe.scheduler = LCMScheduler.from_config(pipe.scheduler.config)
         | 

