Skip to content

Commit 2274a5d

Browse files
authored
Merge branch 'master' into codex/history-query-validation
2 parents 74547bf + acd7185 commit 2274a5d

File tree

7 files changed

+642
-37
lines changed

7 files changed

+642
-37
lines changed

QUANTIZATION.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,9 @@ Example:
139139
"_quantization_metadata": {
140140
"format_version": "1.0",
141141
"layers": {
142-
"model.layers.0.mlp.up_proj": "float8_e4m3fn",
143-
"model.layers.0.mlp.down_proj": "float8_e4m3fn",
144-
"model.layers.1.mlp.up_proj": "float8_e4m3fn"
142+
"model.layers.0.mlp.up_proj": {"format": "float8_e4m3fn"},
143+
"model.layers.0.mlp.down_proj": {"format": "float8_e4m3fn"},
144+
"model.layers.1.mlp.up_proj": {"format": "float8_e4m3fn"}
145145
}
146146
}
147147
}
@@ -165,4 +165,4 @@ Activation quantization (e.g., for FP8 Tensor Core operations) requires `input_s
165165
3. **Compute scales**: Derive `input_scale` from collected statistics
166166
4. **Store in checkpoint**: Save `input_scale` parameters alongside weights
167167

168-
The calibration dataset should be representative of your target use case. For diffusion models, this typically means a diverse set of prompts and generation parameters.
168+
The calibration dataset should be representative of your target use case. For diffusion models, this typically means a diverse set of prompts and generation parameters.

comfy/text_encoders/ernie.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import comfy.text_encoders.llama
44

55
class Ministral3_3BTokenizer(Mistral3Tokenizer):
6-
def __init__(self, embedding_directory=None, embedding_size=5120, embedding_key='mistral3_24b', tokenizer_data={}):
6+
def __init__(self, embedding_directory=None, embedding_size=5120, embedding_key='ministral3_3b', tokenizer_data={}):
77
return super().__init__(embedding_directory=embedding_directory, embedding_size=embedding_size, embedding_key=embedding_key, tokenizer_data=tokenizer_data)
88

99
class ErnieTokenizer(sd1_clip.SD1Tokenizer):

comfy_api_nodes/apis/bytedance.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,26 @@ class TaskImageContent(BaseModel):
5252
role: Literal["first_frame", "last_frame", "reference_image"] | None = Field(None)
5353

5454

55+
class TaskVideoContentUrl(BaseModel):
56+
url: str = Field(...)
57+
58+
59+
class TaskVideoContent(BaseModel):
60+
type: str = Field("video_url")
61+
video_url: TaskVideoContentUrl = Field(...)
62+
role: str = Field("reference_video")
63+
64+
65+
class TaskAudioContentUrl(BaseModel):
66+
url: str = Field(...)
67+
68+
69+
class TaskAudioContent(BaseModel):
70+
type: str = Field("audio_url")
71+
audio_url: TaskAudioContentUrl = Field(...)
72+
role: str = Field("reference_audio")
73+
74+
5575
class Text2VideoTaskCreationRequest(BaseModel):
5676
model: str = Field(...)
5777
content: list[TaskTextContent] = Field(..., min_length=1)
@@ -64,6 +84,17 @@ class Image2VideoTaskCreationRequest(BaseModel):
6484
generate_audio: bool | None = Field(...)
6585

6686

87+
class Seedance2TaskCreationRequest(BaseModel):
88+
model: str = Field(...)
89+
content: list[TaskTextContent | TaskImageContent | TaskVideoContent | TaskAudioContent] = Field(..., min_length=1)
90+
generate_audio: bool | None = Field(None)
91+
resolution: str | None = Field(None)
92+
ratio: str | None = Field(None)
93+
duration: int | None = Field(None, ge=4, le=15)
94+
seed: int | None = Field(None, ge=0, le=2147483647)
95+
watermark: bool | None = Field(None)
96+
97+
6798
class TaskCreationResponse(BaseModel):
6899
id: str = Field(...)
69100

@@ -77,12 +108,27 @@ class TaskStatusResult(BaseModel):
77108
video_url: str = Field(...)
78109

79110

111+
class TaskStatusUsage(BaseModel):
112+
completion_tokens: int = Field(0)
113+
total_tokens: int = Field(0)
114+
115+
80116
class TaskStatusResponse(BaseModel):
81117
id: str = Field(...)
82118
model: str = Field(...)
83119
status: Literal["queued", "running", "cancelled", "succeeded", "failed"] = Field(...)
84120
error: TaskStatusError | None = Field(None)
85121
content: TaskStatusResult | None = Field(None)
122+
usage: TaskStatusUsage | None = Field(None)
123+
124+
125+
# Dollars per 1K tokens, keyed by (model_id, has_video_input).
126+
SEEDANCE2_PRICE_PER_1K_TOKENS = {
127+
("dreamina-seedance-2-0-260128", False): 0.007,
128+
("dreamina-seedance-2-0-260128", True): 0.0043,
129+
("dreamina-seedance-2-0-fast-260128", False): 0.0056,
130+
("dreamina-seedance-2-0-fast-260128", True): 0.0033,
131+
}
86132

87133

88134
RECOMMENDED_PRESETS = [
@@ -112,6 +158,12 @@ class TaskStatusResponse(BaseModel):
112158
("Custom", None, None),
113159
]
114160

161+
# Seedance 2.0 reference video pixel count limits per model.
162+
SEEDANCE2_REF_VIDEO_PIXEL_LIMITS = {
163+
"dreamina-seedance-2-0-260128": {"min": 409_600, "max": 927_408},
164+
"dreamina-seedance-2-0-fast-260128": {"min": 409_600, "max": 927_408},
165+
}
166+
115167
# The time in this dictionary are given for 10 seconds duration.
116168
VIDEO_TASKS_EXECUTION_TIME = {
117169
"seedance-1-0-lite-t2v-250428": {

0 commit comments

Comments
 (0)