Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions comfy/text_encoders/ace15.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,14 @@ def load_sd(self, sd):
return getattr(self, self.lm_model).load_sd(sd)

def memory_estimation_function(self, token_weight_pairs, device=None):
lm_metadata = token_weight_pairs["lm_metadata"]
lm_metadata = token_weight_pairs.get("lm_metadata", {})
constant = self.constant
if comfy.model_management.should_use_bf16(device):
constant *= 0.5

token_weight_pairs = token_weight_pairs.get("lm_prompt", [])
num_tokens = sum(map(lambda a: len(a), token_weight_pairs))
num_tokens += lm_metadata['min_tokens']
num_tokens += lm_metadata.get("min_tokens", 0)
return num_tokens * constant * 1024 * 1024

def te(dtype_llama=None, llama_quantization_metadata=None, lm_model="qwen3_2b"):
Expand Down
26 changes: 15 additions & 11 deletions comfy_extras/nodes_resolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ class AspectRatio(str, Enum):
WIDESCREEN_V = "9:16 (Portrait Widescreen)"


ASPECT_RATIOS: dict[str, tuple[int, int]] = {
"1:1 (Square)": (1, 1),
"3:2 (Photo)": (3, 2),
"4:3 (Standard)": (4, 3),
"16:9 (Widescreen)": (16, 9),
"21:9 (Ultrawide)": (21, 9),
"2:3 (Portrait Photo)": (2, 3),
"3:4 (Portrait Standard)": (3, 4),
"9:16 (Portrait Widescreen)": (9, 16),
ASPECT_RATIOS: dict[AspectRatio, tuple[int, int]] = {
AspectRatio.SQUARE: (1, 1),
AspectRatio.PHOTO_H: (3, 2),
AspectRatio.STANDARD_H: (4, 3),
AspectRatio.WIDESCREEN_H: (16, 9),
AspectRatio.ULTRAWIDE_H: (21, 9),
AspectRatio.PHOTO_V: (2, 3),
AspectRatio.STANDARD_V: (3, 4),
AspectRatio.WIDESCREEN_V: (9, 16),
}


Expand Down Expand Up @@ -55,8 +55,12 @@ def define_schema(cls):
),
],
outputs=[
io.Int.Output("width", tooltip="Calculated width in pixels (multiple of 8)."),
io.Int.Output("height", tooltip="Calculated height in pixels (multiple of 8)."),
io.Int.Output(
"width", tooltip="Calculated width in pixels (multiple of 8)."
),
io.Int.Output(
"height", tooltip="Calculated height in pixels (multiple of 8)."
),
],
)

Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,4 @@ spandrel
pydantic~=2.0
pydantic-settings~=2.0
PyOpenGL
PyOpenGL-accelerate
glfw
Loading