Views
No views yet
diffusers with a customized pipeline github. To run the model (especially with LCM variant), first install the latest version of diffusers library as well as accelerate and transformers.1pip install --upgrade pip
2pip install --upgrade diffusers transformers accelerate1git clone https://github.com/mhh0318/OneMoreStep.git
2cd OneMoreStepstabilityai/stable-diffusion-xl-base-1.0.
And all the SDXL based model and its LoRA can share the same OMS h1t/oms_b_openclip_xl.1import torch
2from diffusers import StableDiffusionXLPipeline, LCMScheduler
3
4sd_pipe = StableDiffusionXLPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16, variant="fp16", add_watermarker=False).to('cuda')
5
6sd_scheduler = LCMScheduler.from_config(sd_pipe.scheduler.config)
7sd_pipe.load_lora_weights('latent-consistency/lcm-lora-sdxl', variant="fp16").safetensors to HuggingFace Hub. There are 2 choices for SDXL backbone currently, one is base OMS module with OpenCLIP text encoder h1t/oms_b_openclip_xl) and the other is large OMS module with two text encoder followed by SDXL architecture h1t/oms_l_mixclip_xl).1from diffusers_patch import OMSPipeline
2
3pipe = OMSPipeline.from_pretrained('h1t/oms_b_openclip_xl', sd_pipeline = sd_pipe, torch_dtype=torch.float16, variant="fp16", trust_remote_code=True, sd_scheduler=sd_scheduler)
4pipe.to('cuda')1prompt = 'close-up photography of old man standing in the rain at night, in a street lit by lamps, leica 35mm summilux'
2generator = torch.Generator(device=pipe.device).manual_seed(1024)
3
4image = pipe(prompt, guidance_scale=1, num_inference_steps=4, generator=generator)
5image['images'][0]1image = pipe(prompt, guidance_scale=1, num_inference_steps=4, generator=generator, oms_flag=False)
2image['images'][0]