Skip to content

Commit

Permalink
compatible fix for #37 and #38
Browse files Browse the repository at this point in the history
  • Loading branch information
Kahsolt committed Sep 9, 2023
1 parent 433782e commit ea9c75d
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions scripts/prompt_travel.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,25 @@
from modules.processing import Processed, StableDiffusionProcessing as Processing, StableDiffusionProcessingTxt2Img as ProcessingTxt2Img, StableDiffusionProcessingImg2Img as ProcessingImg2Img
from modules.images import resize_image
from modules.sd_samplers_common import single_sample_to_image
from modules.prompt_parser import DictWithShape

'''
DictWithShape {
'crossattn': Tensor,
'vector': Tensor,
}
'''

try:
from modules.prompt_parser import DictWithShape
except ImportError:
'''
DictWithShape {
'crossattn': Tensor,
'vector': Tensor,
}
'''
class DictWithShape(dict):
def __init__(self, x, shape):
super().__init__()
self.update(x)

@property
def shape(self):
return self["crossattn"].shape

Cond = Union[Tensor, DictWithShape]

class Mode(Enum):
Expand Down

0 comments on commit ea9c75d

Please sign in to comment.