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

do you plan to release IC-Light SDXL? #79

Open
mikebilly opened this issue Aug 6, 2024 · 3 comments
Open

do you plan to release IC-Light SDXL? #79

mikebilly opened this issue Aug 6, 2024 · 3 comments

Comments

@mikebilly
Copy link

No description provided.

@SoonNOON
Copy link

SoonNOON commented Sep 2, 2024

import torch
from diffusers import StableDiffusionXLPipeline, DPMSolverMultistepScheduler

Function to create the pipeline

def create_pipeline(pipeline_type='text-to-image', scheduler=None, model_name=None):
"""Creates and returns a Stable Diffusion pipeline based on the specified type."""

if scheduler is None:
    scheduler = DPMSolverMultistepScheduler(
        num_train_timesteps=1000,
        beta_start=0.00085,
        beta_end=0.012,
        algorithm_type="sde-dpmsolver++",
        use_karras_sigmas=True,
        steps_offset=1
    )

if model_name == 'sdxl':
    return StableDiffusionXLPipeline.from_pretrained('stablediffusionapi/sdxl-1.0', torch_dtype=torch.float16)

common_kwargs = {
    'vae': vae,
    'text_encoder': text_encoder,
    'tokenizer': tokenizer,
    'unet': unet,
    'scheduler': scheduler,
    'safety_checker': None,
    'requires_safety_checker': False,
    'feature_extractor': None,
    'image_encoder': None
}

if pipeline_type == 'text-to-image':
    return StableDiffusionPipeline(**common_kwargs)
elif pipeline_type == 'image-to-image':
    return StableDiffusionImg2ImgPipeline(**common_kwargs)
else:
    raise ValueError(f"Unknown pipeline type: {pipeline_type}")

Creating the SDXL pipeline

sdxl_t2i_pipe = create_pipeline('text-to-image', model_name='sdxl')

@mikebilly
Copy link
Author

@SoonNOON what is that

@SoonNOON
Copy link

SoonNOON commented Sep 4, 2024

Sorry, I put this by mistake. I was testing if GPT4o understood how to implement something new.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants