MCPcopy Create free account
hub / github.com/aistudynow/Comfyui-bitdance / encode

Method encode

nodes.py:1700–1736  ·  view source on GitHub ↗
(
        self,
        text_encoder: BitDanceTextRuntime,
        positive_prompt: str,
        negative_prompt: str,
        force_offload: bool = True,
        model_to_offload: Optional[BitDanceModelRuntime] = None,
        use_disk_cache: bool = False,
        device: str = "gpu",
    )

Source from the content-addressed store, hash-verified

1698 CATEGORY = "conditioning/bitdance"
1699
1700 def encode(
1701 self,
1702 text_encoder: BitDanceTextRuntime,
1703 positive_prompt: str,
1704 negative_prompt: str,
1705 force_offload: bool = True,
1706 model_to_offload: Optional[BitDanceModelRuntime] = None,
1707 use_disk_cache: bool = False,
1708 device: str = "gpu",
1709 ):
1710 embeds = _encode_bitdance_text_prompts(
1711 text_encoder,
1712 positive_prompt,
1713 negative_prompt,
1714 device_mode=device,
1715 use_disk_cache=use_disk_cache,
1716 force_offload=force_offload,
1717 model_to_offload=model_to_offload,
1718 )
1719
1720 pos_only = BitDanceTextEmbedsRuntime(
1721 prompt_embeds=embeds.prompt_embeds,
1722 negative_prompt_embeds=None,
1723 text_runtime=text_encoder,
1724 positive_prompt=embeds.positive_prompt,
1725 negative_prompt=embeds.negative_prompt,
1726 )
1727 neg_only = BitDanceTextEmbedsRuntime(
1728 prompt_embeds=embeds.negative_prompt_embeds
1729 if embeds.negative_prompt_embeds is not None
1730 else embeds.prompt_embeds,
1731 negative_prompt_embeds=None,
1732 text_runtime=text_encoder,
1733 positive_prompt="",
1734 negative_prompt=embeds.negative_prompt,
1735 )
1736 return (pos_only, neg_only, embeds.positive_prompt)
1737
1738
1739class BitDanceTextEncodeCached:

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected