Disty0
commited on
Commit
·
384f3c3
1
Parent(s):
210fb9d
Fix single batches
Browse files- pipeline.py +5 -1
pipeline.py
CHANGED
@@ -28,6 +28,10 @@ from diffusers.utils.import_utils import is_xformers_available
|
|
28 |
|
29 |
|
30 |
def to_rgb_image(maybe_rgba: Image.Image):
|
|
|
|
|
|
|
|
|
31 |
if maybe_rgba.mode == 'RGB':
|
32 |
return maybe_rgba
|
33 |
elif maybe_rgba.mode == 'RGBA':
|
@@ -326,8 +330,8 @@ class Zero123PlusPipeline(diffusers.StableDiffusionPipeline):
|
|
326 |
@torch.no_grad()
|
327 |
def __call__(
|
328 |
self,
|
|
|
329 |
prompt = "",
|
330 |
-
image = None,
|
331 |
*args,
|
332 |
num_images_per_prompt: Optional[int] = 1,
|
333 |
guidance_scale=4.0,
|
|
|
28 |
|
29 |
|
30 |
def to_rgb_image(maybe_rgba: Image.Image):
|
31 |
+
if isinstance(maybe_rgba, list):
|
32 |
+
if len(maybe_rgba > 1):
|
33 |
+
assert "Batch sizes are not supported!"
|
34 |
+
maybe_rgba = maybe_rgba[0]
|
35 |
if maybe_rgba.mode == 'RGB':
|
36 |
return maybe_rgba
|
37 |
elif maybe_rgba.mode == 'RGBA':
|
|
|
330 |
@torch.no_grad()
|
331 |
def __call__(
|
332 |
self,
|
333 |
+
image: Image.Image = None,
|
334 |
prompt = "",
|
|
|
335 |
*args,
|
336 |
num_images_per_prompt: Optional[int] = 1,
|
337 |
guidance_scale=4.0,
|