refactor(script): reduce complexity

This commit is contained in:
Dowon
2024-08-24 13:51:11 +09:00
parent 18d8db995f
commit 79a74819cb
2 changed files with 44 additions and 27 deletions

View File

@@ -5,6 +5,8 @@ from copy import copy
from typing import TYPE_CHECKING, Any, Union
import torch
from PIL import Image
from typing_extensions import Protocol
from modules import safe
from modules.shared import opts
@@ -57,3 +59,7 @@ def preserve_prompts(p: PT):
def copy_extra_params(extra_params: dict[str, Any]) -> dict[str, Any]:
return {k: v for k, v in extra_params.items() if not callable(v)}
class PPImage(Protocol):
image: Image.Image