Provide speaker identity context for audio generation. Patchifies the audio latent and attaches it as reference tokens on both positive and negative conditioning. The model prepends these tokens with negative temporal positions so they serve as identity context without being part of
| 532 | |
| 533 | @comfy_node(name="LTXVSetAudioRefTokens") |
| 534 | class LTXVSetAudioRefTokens(io.ComfyNode): |
| 535 | """Provide speaker identity context for audio generation. |
| 536 | |
| 537 | Patchifies the audio latent and attaches it as reference tokens on both |
| 538 | positive and negative conditioning. The model prepends these tokens with |
| 539 | negative temporal positions so they serve as identity context without |
| 540 | being part of the generated output. |
| 541 | |
| 542 | Also outputs a frozen copy of the audio latent (noise_mask=0) for |
| 543 | direct use in stage 2 without re-encoding. |
| 544 | """ |
| 545 | |
| 546 | @classmethod |
| 547 | def define_schema(cls): |
| 548 | return io.Schema( |
| 549 | node_id="LTXVSetAudioRefTokens", |
| 550 | display_name=NODES_DISPLAY_NAME_PREFIX + " Set Audio Ref Tokens", |
| 551 | category="Lightricks/IC-LoRA", |
| 552 | description=( |
| 553 | "Provides speaker identity context for audio generation by attaching " |
| 554 | "reference audio tokens to the conditioning. The tokens are prepended " |
| 555 | "with negative temporal positions so the model treats them as context " |
| 556 | "rather than generation targets." |
| 557 | ), |
| 558 | inputs=[ |
| 559 | io.Conditioning.Input( |
| 560 | "positive", |
| 561 | tooltip="Positive conditioning to attach the reference audio tokens to.", |
| 562 | ), |
| 563 | io.Conditioning.Input( |
| 564 | "negative", |
| 565 | tooltip="Negative conditioning to attach the reference audio tokens to.", |
| 566 | ), |
| 567 | io.Latent.Input( |
| 568 | "audio_latent", |
| 569 | tooltip="Encoded audio latent from LTXV Audio VAE Encode.", |
| 570 | ), |
| 571 | ], |
| 572 | outputs=[ |
| 573 | io.Conditioning.Output( |
| 574 | display_name="positive", |
| 575 | tooltip="Positive conditioning with reference audio tokens attached.", |
| 576 | ), |
| 577 | io.Conditioning.Output( |
| 578 | display_name="negative", |
| 579 | tooltip="Negative conditioning with reference audio tokens attached.", |
| 580 | ), |
| 581 | io.Latent.Output( |
| 582 | display_name="frozen_audio", |
| 583 | tooltip="Audio latent with noise_mask=0, fully frozen during denoising.", |
| 584 | ), |
| 585 | ], |
| 586 | ) |
| 587 | |
| 588 | @classmethod |
| 589 | def execute(cls, positive, negative, audio_latent) -> io.NodeOutput: |
| 590 | latent = audio_latent["samples"] |
| 591 | ref_audio = _patchify_audio_latent(latent) |
nothing calls this directly
no outgoing calls
no test coverage detected