File size: 503 Bytes
2ec2ebd
 
 
 
 
 
c0237de
b1e8435
c0237de
b1e8435
c0237de
2ec2ebd
1
2
3
4
5
6
7
8
9
10
11
12
from diffusers import StableDiffusionPipeline, EulerDiscreteScheduler

pipeline = StableDiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4")
pipeline.scheduler = EulerDiscreteScheduler.from_config(pipeline.scheduler.config)

def get_images(prompt, skip_layers=0):
    print('inside get images')
    pipeline_output = pipeline(prompt, skip_layers=skip_layers, num_images_per_prompt=1)
    print('after pipeline')
    images = pipeline_output.images
    print('got images')
    return images