Spaces:
Running
on
L4
Running
on
L4
Update
Browse files
model.py
CHANGED
@@ -140,6 +140,8 @@ class Model:
|
|
140 |
low_threshold: int,
|
141 |
high_threshold: int,
|
142 |
) -> list[PIL.Image.Image]:
|
|
|
|
|
143 |
if image_resolution > MAX_IMAGE_RESOLUTION:
|
144 |
raise ValueError
|
145 |
if num_images > MAX_NUM_IMAGES:
|
@@ -179,6 +181,8 @@ class Model:
|
|
179 |
value_threshold: float,
|
180 |
distance_threshold: float,
|
181 |
) -> list[PIL.Image.Image]:
|
|
|
|
|
182 |
if image_resolution > MAX_IMAGE_RESOLUTION:
|
183 |
raise ValueError
|
184 |
if num_images > MAX_NUM_IMAGES:
|
@@ -219,6 +223,8 @@ class Model:
|
|
219 |
seed: int,
|
220 |
preprocessor_name: str,
|
221 |
) -> list[PIL.Image.Image]:
|
|
|
|
|
222 |
if image_resolution > MAX_IMAGE_RESOLUTION:
|
223 |
raise ValueError
|
224 |
if num_images > MAX_NUM_IMAGES:
|
@@ -269,6 +275,8 @@ class Model:
|
|
269 |
guidance_scale: float,
|
270 |
seed: int,
|
271 |
) -> list[PIL.Image.Image]:
|
|
|
|
|
272 |
if image_resolution > MAX_IMAGE_RESOLUTION:
|
273 |
raise ValueError
|
274 |
if num_images > MAX_NUM_IMAGES:
|
@@ -306,6 +314,8 @@ class Model:
|
|
306 |
seed: int,
|
307 |
preprocessor_name: str,
|
308 |
) -> list[PIL.Image.Image]:
|
|
|
|
|
309 |
if image_resolution > MAX_IMAGE_RESOLUTION:
|
310 |
raise ValueError
|
311 |
if num_images > MAX_NUM_IMAGES:
|
@@ -362,6 +372,8 @@ class Model:
|
|
362 |
seed: int,
|
363 |
preprocessor_name: str,
|
364 |
) -> list[PIL.Image.Image]:
|
|
|
|
|
365 |
if image_resolution > MAX_IMAGE_RESOLUTION:
|
366 |
raise ValueError
|
367 |
if num_images > MAX_NUM_IMAGES:
|
@@ -406,6 +418,8 @@ class Model:
|
|
406 |
seed: int,
|
407 |
preprocessor_name: str,
|
408 |
) -> list[PIL.Image.Image]:
|
|
|
|
|
409 |
if image_resolution > MAX_IMAGE_RESOLUTION:
|
410 |
raise ValueError
|
411 |
if num_images > MAX_NUM_IMAGES:
|
@@ -449,6 +463,8 @@ class Model:
|
|
449 |
seed: int,
|
450 |
preprocessor_name: str,
|
451 |
) -> list[PIL.Image.Image]:
|
|
|
|
|
452 |
if image_resolution > MAX_IMAGE_RESOLUTION:
|
453 |
raise ValueError
|
454 |
if num_images > MAX_NUM_IMAGES:
|
@@ -492,6 +508,8 @@ class Model:
|
|
492 |
seed: int,
|
493 |
preprocessor_name: str,
|
494 |
) -> list[PIL.Image.Image]:
|
|
|
|
|
495 |
if image_resolution > MAX_IMAGE_RESOLUTION:
|
496 |
raise ValueError
|
497 |
if num_images > MAX_NUM_IMAGES:
|
@@ -535,6 +553,8 @@ class Model:
|
|
535 |
seed: int,
|
536 |
preprocessor_name: str,
|
537 |
) -> list[PIL.Image.Image]:
|
|
|
|
|
538 |
if image_resolution > MAX_IMAGE_RESOLUTION:
|
539 |
raise ValueError
|
540 |
if num_images > MAX_NUM_IMAGES:
|
@@ -589,6 +609,8 @@ class Model:
|
|
589 |
seed: int,
|
590 |
preprocessor_name: str,
|
591 |
) -> list[PIL.Image.Image]:
|
|
|
|
|
592 |
if image_resolution > MAX_IMAGE_RESOLUTION:
|
593 |
raise ValueError
|
594 |
if num_images > MAX_NUM_IMAGES:
|
@@ -629,6 +651,8 @@ class Model:
|
|
629 |
guidance_scale: float,
|
630 |
seed: int,
|
631 |
) -> list[PIL.Image.Image]:
|
|
|
|
|
632 |
if image_resolution > MAX_IMAGE_RESOLUTION:
|
633 |
raise ValueError
|
634 |
if num_images > MAX_NUM_IMAGES:
|
|
|
140 |
low_threshold: int,
|
141 |
high_threshold: int,
|
142 |
) -> list[PIL.Image.Image]:
|
143 |
+
if image is None:
|
144 |
+
raise ValueError
|
145 |
if image_resolution > MAX_IMAGE_RESOLUTION:
|
146 |
raise ValueError
|
147 |
if num_images > MAX_NUM_IMAGES:
|
|
|
181 |
value_threshold: float,
|
182 |
distance_threshold: float,
|
183 |
) -> list[PIL.Image.Image]:
|
184 |
+
if image is None:
|
185 |
+
raise ValueError
|
186 |
if image_resolution > MAX_IMAGE_RESOLUTION:
|
187 |
raise ValueError
|
188 |
if num_images > MAX_NUM_IMAGES:
|
|
|
223 |
seed: int,
|
224 |
preprocessor_name: str,
|
225 |
) -> list[PIL.Image.Image]:
|
226 |
+
if image is None:
|
227 |
+
raise ValueError
|
228 |
if image_resolution > MAX_IMAGE_RESOLUTION:
|
229 |
raise ValueError
|
230 |
if num_images > MAX_NUM_IMAGES:
|
|
|
275 |
guidance_scale: float,
|
276 |
seed: int,
|
277 |
) -> list[PIL.Image.Image]:
|
278 |
+
if image_and_mask is None:
|
279 |
+
raise ValueError
|
280 |
if image_resolution > MAX_IMAGE_RESOLUTION:
|
281 |
raise ValueError
|
282 |
if num_images > MAX_NUM_IMAGES:
|
|
|
314 |
seed: int,
|
315 |
preprocessor_name: str,
|
316 |
) -> list[PIL.Image.Image]:
|
317 |
+
if image is None:
|
318 |
+
raise ValueError
|
319 |
if image_resolution > MAX_IMAGE_RESOLUTION:
|
320 |
raise ValueError
|
321 |
if num_images > MAX_NUM_IMAGES:
|
|
|
372 |
seed: int,
|
373 |
preprocessor_name: str,
|
374 |
) -> list[PIL.Image.Image]:
|
375 |
+
if image is None:
|
376 |
+
raise ValueError
|
377 |
if image_resolution > MAX_IMAGE_RESOLUTION:
|
378 |
raise ValueError
|
379 |
if num_images > MAX_NUM_IMAGES:
|
|
|
418 |
seed: int,
|
419 |
preprocessor_name: str,
|
420 |
) -> list[PIL.Image.Image]:
|
421 |
+
if image is None:
|
422 |
+
raise ValueError
|
423 |
if image_resolution > MAX_IMAGE_RESOLUTION:
|
424 |
raise ValueError
|
425 |
if num_images > MAX_NUM_IMAGES:
|
|
|
463 |
seed: int,
|
464 |
preprocessor_name: str,
|
465 |
) -> list[PIL.Image.Image]:
|
466 |
+
if image is None:
|
467 |
+
raise ValueError
|
468 |
if image_resolution > MAX_IMAGE_RESOLUTION:
|
469 |
raise ValueError
|
470 |
if num_images > MAX_NUM_IMAGES:
|
|
|
508 |
seed: int,
|
509 |
preprocessor_name: str,
|
510 |
) -> list[PIL.Image.Image]:
|
511 |
+
if image is None:
|
512 |
+
raise ValueError
|
513 |
if image_resolution > MAX_IMAGE_RESOLUTION:
|
514 |
raise ValueError
|
515 |
if num_images > MAX_NUM_IMAGES:
|
|
|
553 |
seed: int,
|
554 |
preprocessor_name: str,
|
555 |
) -> list[PIL.Image.Image]:
|
556 |
+
if image is None:
|
557 |
+
raise ValueError
|
558 |
if image_resolution > MAX_IMAGE_RESOLUTION:
|
559 |
raise ValueError
|
560 |
if num_images > MAX_NUM_IMAGES:
|
|
|
609 |
seed: int,
|
610 |
preprocessor_name: str,
|
611 |
) -> list[PIL.Image.Image]:
|
612 |
+
if image is None:
|
613 |
+
raise ValueError
|
614 |
if image_resolution > MAX_IMAGE_RESOLUTION:
|
615 |
raise ValueError
|
616 |
if num_images > MAX_NUM_IMAGES:
|
|
|
651 |
guidance_scale: float,
|
652 |
seed: int,
|
653 |
) -> list[PIL.Image.Image]:
|
654 |
+
if image is None:
|
655 |
+
raise ValueError
|
656 |
if image_resolution > MAX_IMAGE_RESOLUTION:
|
657 |
raise ValueError
|
658 |
if num_images > MAX_NUM_IMAGES:
|