Update image_generator.py
Browse files- image_generator.py +2 -2
image_generator.py
CHANGED
@@ -28,9 +28,9 @@ def set_scheduler(pipe, scheduler_type):
|
|
28 |
pipe.scheduler = DPMSolverMultistepScheduler(use_karras_sigmas="yes")
|
29 |
return pipe
|
30 |
|
31 |
-
def generate_image(prompt, num_inference_steps, seed, guidance_scale, negative_prompt=None, pipe_id="Linaqruf/animagine-xl", scheduler_type="LCM"):
|
32 |
global loaded_pipe
|
33 |
-
pipe = load_model(pipe_id)
|
34 |
pipe = set_scheduler(pipe, scheduler_type)
|
35 |
generator = torch.manual_seed(seed)
|
36 |
image = pipe(prompt=prompt, negative_prompt=negative_prompt, num_inference_steps=num_inference_steps, generator=generator, guidance_scale=guidance_scale).images[0]
|
|
|
28 |
pipe.scheduler = DPMSolverMultistepScheduler(use_karras_sigmas="yes")
|
29 |
return pipe
|
30 |
|
31 |
+
def generate_image(prompt, num_inference_steps, seed, guidance_scale, negative_prompt=None, pipe_id="Linaqruf/animagine-xl", unet_model_id="latent-consistency/lcm-sdxl", scheduler_type="LCM"):
|
32 |
global loaded_pipe
|
33 |
+
pipe = load_model(pipe_id, unet_model_id)
|
34 |
pipe = set_scheduler(pipe, scheduler_type)
|
35 |
generator = torch.manual_seed(seed)
|
36 |
image = pipe(prompt=prompt, negative_prompt=negative_prompt, num_inference_steps=num_inference_steps, generator=generator, guidance_scale=guidance_scale).images[0]
|