Spaces:
Sleeping
Sleeping
Create live_preview_helpers
Browse files- live_preview_helpers +14 -0
live_preview_helpers
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from PIL import Image, ImageDraw
|
2 |
+
import io
|
3 |
+
|
4 |
+
def flux_pipe_call_that_returns_an_iterable_of_images(prompt, guidance_scale, num_inference_steps, width, height, generator, output_type, good_vae):
|
5 |
+
"""
|
6 |
+
Gera imagens simples como substituto para a funcionalidade ausente.
|
7 |
+
"""
|
8 |
+
images = []
|
9 |
+
for i in range(3): # Exemplo: gerando 3 imagens
|
10 |
+
img = Image.new("RGB", (width, height), color=(255, 200 - i * 50, 200 - i * 50))
|
11 |
+
draw = ImageDraw.Draw(img)
|
12 |
+
draw.text((20, 20), f"Prompt: {prompt}\nImage {i+1}", fill=(0, 0, 0))
|
13 |
+
images.append(img)
|
14 |
+
return images
|