Skip to content

Commit d4c4926

Browse files
Update Compel to 2.1.1 and apply Sentences Split logic
1 parent 558c7db commit d4c4926

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

invokeai/app/invocations/compel.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import Iterator, List, Optional, Tuple, Union, cast
22

33
import torch
4-
from compel import Compel, ReturnedEmbeddingsType
4+
from compel import Compel, ReturnedEmbeddingsType, SplitLongTextMode
55
from compel.prompt_parser import Blend, Conjunction, CrossAttentionControlSubstitute, FlattenedPrompt, Fragment
66
from transformers import CLIPTextModel, CLIPTextModelWithProjection, CLIPTokenizer
77

@@ -104,6 +104,7 @@ def _lora_loader() -> Iterator[Tuple[ModelPatchRaw, float]]:
104104
dtype_for_device_getter=TorchDevice.choose_torch_dtype,
105105
truncate_long_prompts=False,
106106
device=TorchDevice.choose_torch_device(),
107+
split_long_text_mode=SplitLongTextMode.SENTENCES,
107108
)
108109

109110
conjunction = Compel.parse_prompt_string(self.prompt)
@@ -205,6 +206,7 @@ def _lora_loader() -> Iterator[Tuple[ModelPatchRaw, float]]:
205206
returned_embeddings_type=ReturnedEmbeddingsType.PENULTIMATE_HIDDEN_STATES_NON_NORMALIZED, # TODO: clip skip
206207
requires_pooled=get_pooled,
207208
device=TorchDevice.choose_torch_device(),
209+
split_long_text_mode=SplitLongTextMode.SENTENCES,
208210
)
209211

210212
conjunction = Compel.parse_prompt_string(prompt)

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ readme = { content-type = "text/markdown", file = "README.md" }
1010
keywords = ["stable-diffusion", "AI"]
1111
dynamic = ["version"]
1212
license = { file = "LICENSE" }
13-
authors = [{ name = "The InvokeAI Project", email = "lincoln.stein@gmail.com" }]
13+
authors = [{ name = "Invoke", email = "support@invoke.ai" }]
1414
classifiers = [
15-
'Development Status :: 4 - Beta',
15+
'Development Status :: 5 - Production/Stable',
1616
'Environment :: GPU',
1717
'Environment :: GPU :: NVIDIA CUDA',
1818
'Environment :: MacOS X',
1919
'Intended Audience :: End Users/Desktop',
2020
'Intended Audience :: Developers',
21-
'License :: OSI Approved :: MIT License',
21+
'License :: OSI Approved :: Apache-2.0',
2222
'Operating System :: POSIX :: Linux',
2323
'Operating System :: MacOS',
2424
'Operating System :: Microsoft :: Windows',
2525
'Programming Language :: Python :: 3 :: Only',
26-
'Programming Language :: Python :: 3.10',
26+
'Programming Language :: Python :: 3.12',
2727
'Topic :: Artistic Software',
2828
'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
2929
'Topic :: Internet :: WWW/HTTP :: WSGI :: Server',
@@ -35,7 +35,7 @@ dependencies = [
3535
# Core generation dependencies, pinned for reproducible builds.
3636
"accelerate",
3737
"bitsandbytes; sys_platform!='darwin'",
38-
"compel==2.0.2",
38+
"compel==2.1.1",
3939
"diffusers[torch]==0.33.0",
4040
"gguf",
4141
"invisible-watermark==0.2.0", # needed to install SDXL base and refiner using their repo_ids

0 commit comments

Comments
 (0)