diff options
author | a666 <19142162+a666@users.noreply.github.com> | 2023-08-25 07:58:19 +0000 |
---|---|---|
committer | a666 <19142162+a666@users.noreply.github.com> | 2023-08-29 06:54:57 +0000 |
commit | b6c1a1bbbf29a3041025aa336f6f843ffd7c7d46 (patch) | |
tree | 40015e451e0e578440bfaaed93a6b4f7a63851c4 /modules/prompt_parser.py | |
parent | 84d41e49b3674699155ba2b7d80fd6f7f8957b7a (diff) | |
download | stable-diffusion-webui-gfx803-b6c1a1bbbf29a3041025aa336f6f843ffd7c7d46.tar.gz stable-diffusion-webui-gfx803-b6c1a1bbbf29a3041025aa336f6f843ffd7c7d46.tar.bz2 stable-diffusion-webui-gfx803-b6c1a1bbbf29a3041025aa336f6f843ffd7c7d46.zip |
Fix some deprecated types
Diffstat (limited to 'modules/prompt_parser.py')
-rw-r--r-- | modules/prompt_parser.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/modules/prompt_parser.py b/modules/prompt_parser.py index 334efeef..ddf4d2dd 100644 --- a/modules/prompt_parser.py +++ b/modules/prompt_parser.py @@ -2,7 +2,6 @@ from __future__ import annotations import re
from collections import namedtuple
-from typing import List
import lark
# a prompt like this: "fantasy landscape with a [mountain:lake:0.25] and [an oak:a christmas tree:0.75][ in foreground::0.6][ in background:0.25] [shoddy:masterful:0.5]"
@@ -240,14 +239,14 @@ def get_multicond_prompt_list(prompts: SdConditioning | list[str]): class ComposableScheduledPromptConditioning:
def __init__(self, schedules, weight=1.0):
- self.schedules: List[ScheduledPromptConditioning] = schedules
+ self.schedules: list[ScheduledPromptConditioning] = schedules
self.weight: float = weight
class MulticondLearnedConditioning:
def __init__(self, shape, batch):
self.shape: tuple = shape # the shape field is needed to send this object to DDIM/PLMS
- self.batch: List[List[ComposableScheduledPromptConditioning]] = batch
+ self.batch: list[list[ComposableScheduledPromptConditioning]] = batch
def get_multicond_learned_conditioning(model, prompts, steps, hires_steps=None, use_old_scheduling=False) -> MulticondLearnedConditioning:
@@ -278,7 +277,7 @@ class DictWithShape(dict): return self["crossattn"].shape
-def reconstruct_cond_batch(c: List[List[ScheduledPromptConditioning]], current_step):
+def reconstruct_cond_batch(c: list[list[ScheduledPromptConditioning]], current_step):
param = c[0][0].cond
is_dict = isinstance(param, dict)
|