File size: 659 Bytes
d154ff2
 
 
 
 
2fa993f
 
d154ff2
 
2fa993f
 
 
 
 
d154ff2
2fa993f
 
 
d154ff2
2fa993f
d154ff2
2fa993f
d154ff2
 
 
 
 
 
 
2fa993f
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# live_preview_helpers.py

import torch
from typing import Iterator

# live_preview_helpers.py

def flux_pipe_call_that_returns_an_iterable_of_images(
    self,
    prompt,
    guidance_scale=7.5,
    num_inference_steps=20,
    width=512,
    height=512,
    generator=None,
    output_type="pil",
    good_vae=None
):
    """
    For StableDiffusion: yields a single image for now.
    """
    image = self(
        prompt=prompt,
        guidance_scale=guidance_scale,
        num_inference_steps=num_inference_steps,
        width=width,
        height=height,
        generator=generator,
        output_type=output_type,
    ).images[0]
    yield image