MCPcopy Create free account
hub / github.com/SandAI-org/MAGI-1 / encode

Method encode

comfyui/comfy_nodes.py:71–79  ·  view source on GitHub ↗
(self, prompt: str, t5_pretrained_path: str, t5_device: str)

Source from the content-addressed store, hash-verified

69 CATEGORY = "Magi"
70
71 def encode(self, prompt: str, t5_pretrained_path: str, t5_device: str):
72 model_config = ModelConfig(model_name="videodit_ardf")
73 config = MagiConfig(model_config=model_config, runtime_config=RuntimeConfig(), engine_config=EngineConfig())
74 config.runtime_config.t5_pretrained = t5_pretrained_path
75 config.runtime_config.t5_device = t5_device
76 config.model_config.caption_max_length = 800
77
78 caption_embs, emb_masks = get_txt_embeddings(prompt, config)
79 return ([caption_embs, emb_masks],)
80
81
82class MagiImageLoader:

Callers

nothing calls this directly

Calls 5

ModelConfigClass · 0.90
MagiConfigClass · 0.90
RuntimeConfigClass · 0.90
EngineConfigClass · 0.90
get_txt_embeddingsFunction · 0.90

Tested by

no test coverage detected