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
2 changes: 1 addition & 1 deletion comfy/ldm/lightricks/vae/audio_vae.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def target_shape_from_latents(self, latents_shape):
self.autoencoder.mel_bins,
)

def num_of_latents_from_frames(self, frames_number: int, frame_rate: int) -> int:
def num_of_latents_from_frames(self, frames_number: int, frame_rate: float) -> int:
return math.ceil((float(frames_number) / frame_rate) * self.latents_per_second)

def run_vocoder(self, mel_spec: torch.Tensor) -> torch.Tensor:
Expand Down
12 changes: 9 additions & 3 deletions comfy_api_nodes/nodes_anthropic.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
CLAUDE_MAX_IMAGES = 20

CLAUDE_MODELS: dict[str, str] = {
"Opus 5": "claude-opus-5",
"Opus 4.8": "claude-opus-4-8",
"Fable 5": "claude-fable-5",
"Sonnet 5": "claude-sonnet-5",
Expand All @@ -42,9 +43,9 @@
# Models that use the newer "adaptive" thinking mode (Opus 4.7+ require it; older models keep the explicit budget API).
# Anthropic decides the actual budget when adaptive is used, based on the `output_config.effort` hint.
_ADAPTIVE_THINKING_MODELS = {"Opus 4.8", "Sonnet 5", "Opus 4.7", "Opus 4.6", "Sonnet 4.6"}
_ALWAYS_THINKING_MODELS = {"Fable 5"}
_ALWAYS_THINKING_MODELS = {"Opus 5", "Fable 5"}
_EXPLICIT_THINKING_OFF_MODELS = {"Sonnet 5"}
_NO_TEMPERATURE_MODELS = {"Opus 4.8", "Fable 5", "Sonnet 5"}
_NO_TEMPERATURE_MODELS = {"Opus 5", "Opus 4.8", "Fable 5", "Sonnet 5"}

# Budget mode (Sonnet 4.5): effort -> reasoning budget in tokens. Must be < max_tokens.
# Sized so even the "high" budget fits comfortably under the default max_tokens=32768.
Expand Down Expand Up @@ -109,7 +110,7 @@ def _model_price_per_million(model: str) -> tuple[float, float] | None:
"""Return (input_per_1M, output_per_1M) USD for a Claude model, or None if unknown."""
if "fable-5" in model:
return 14.30, 71.50
if "opus-4-8" in model:
if "opus-5" in model or "opus-4-8" in model:
return 7.15, 35.75
if "sonnet-5" in model:
return 2.86, 14.30
Expand Down Expand Up @@ -253,6 +254,11 @@ def define_schema(cls):
"usd": [0.00286, 0.0143],
"format": { "approximate": true, "separator": "-", "suffix": " per 1K tokens" }
}
: $contains($m, "opus 5") ? {
"type": "list_usd",
"usd": [0.00715, 0.03575],
"format": { "approximate": true, "separator": "-", "suffix": " per 1K tokens" }
}
: $contains($m, "opus") ? {
"type": "list_usd",
"usd": [0.005, 0.025],
Expand Down
21 changes: 12 additions & 9 deletions comfy_extras/nodes_lt_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,17 @@ def define_schema(cls) -> io.Schema:
display_mode=io.NumberDisplay.number,
tooltip="Number of frames.",
),
io.Int.Input(
"frame_rate",
default=25,
min=1,
max=1000,
step=1,
display_mode=io.NumberDisplay.number,
tooltip="Number of frames per second.",
io.MultiType.Input(
io.Float.Input(
"frame_rate",
default=25.0,
min=1.0,
max=1000.0,
step=0.01,
display_mode=io.NumberDisplay.number,
tooltip="Number of frames per second.",
),
[io.Int],
),
io.Int.Input(
"batch_size",
Expand All @@ -137,7 +140,7 @@ def define_schema(cls) -> io.Schema:
def execute(
cls,
frames_number: int,
frame_rate: int,
frame_rate: float,
batch_size: int,
audio_vae,
) -> io.NodeOutput:
Expand Down
Loading