Optimizations¶
optimizations
¶
Performance optimizations — Step 10.
Installs GPU acceleration libraries from a config-driven package list.
Each package in dependencies.json → optimizations.packages[] declares:
- requires: environment filters (e.g. ["nvidia", "linux"])
- pypi_package: pip name, optionally per-platform
- torch_constraints: version-aware pip specifiers
- install_options / retry_options: uv pip install flags
Skipped entirely if no NVIDIA GPU is detected (all current packages
require "nvidia" in their requires list).
No external scripts are downloaded or executed.
install_sageattention(python_exe, install_path, deps, log)
¶
Install SageAttention wheel(s) based on GPU compute capability.
Iterates all entries in deps.pip_packages.sageattention_wheels
whose compute-capability range matches the detected GPU. On Blackwell
GPUs this installs both SageAttention 2 (stable INT8/FP16 backend used
by --use-sage-attention) and SageAttention 3 (experimental FP4
backend selectable via KJNodes).
Checksums are looked up from tools_manifest.json rather than
hardcoded in dependencies.json. Falls back to PyPI
sageattention with --no-build-isolation only when no
pre-built wheel was installed.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
python_exe
|
Path
|
Path to the venv Python executable. |
required |
install_path
|
Path
|
Root installation directory. |
required |
deps
|
DependenciesConfig
|
Parsed |
required |
log
|
InstallerLogger
|
Installer logger for user-facing messages. |
required |
Source code in src/installer/optimizations.py
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 | |
install_optimizations(python_exe, comfy_path, install_path, deps, log)
¶
Install GPU optimization packages from the config-driven list.
Iterates over deps.optimizations.packages, filters by platform
and GPU, and installs each compatible package via uv.
Skipped entirely if no NVIDIA GPU is detected (all current packages
require "nvidia").
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
python_exe
|
Path
|
Path to the venv Python executable. |
required |
comfy_path
|
Path
|
ComfyUI repository directory. |
required |
install_path
|
Path
|
Root installation directory. |
required |
deps
|
DependenciesConfig
|
Parsed |
required |
log
|
InstallerLogger
|
Installer logger for user-facing messages. |
required |
Source code in src/installer/optimizations.py
411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 | |