pub struct QwenImageEncoder { /* private fields */ }Expand description
Qwen2.5-VL prompt encoder. The component CMF retains the official
model.* and visual.* tensor names, plus U8 image.*_json assets.
Implementations§
Source§impl QwenImageEncoder
impl QwenImageEncoder
Sourcepub fn open(path: &Path) -> Result<Self, String>
pub fn open(path: &Path) -> Result<Self, String>
Open a standalone Qwen2.5-VL component CMF. Sharded CMFs are opened through the core loader so the language and vision mappings remain lazy and no giant F32 embedding copy is created.
Sourcepub fn model_uid(&self) -> u64
pub fn model_uid(&self) -> u64
Stable CMF identity for the caller’s targeted GPU buffer release after this encoder’s stage scope ends. The encoder keeps this value available without exposing its internal model mapping.
Sourcepub fn encode(
&self,
prompt: &str,
images: &[RgbImage],
) -> Result<Conditioning, String>
pub fn encode( &self, prompt: &str, images: &[RgbImage], ) -> Result<Conditioning, String>
Encode a positive or negative prompt with the same reference image list. The caller invokes this once for each true-CFG branch; image preprocessing and vision placeholders therefore remain identical.
Sourcepub fn encode_pair(
&self,
prompt: &str,
negative_prompt: &str,
images: &[RgbImage],
) -> Result<(Conditioning, Conditioning), String>
pub fn encode_pair( &self, prompt: &str, negative_prompt: &str, images: &[RgbImage], ) -> Result<(Conditioning, Conditioning), String>
Name matching the pipeline’s positive/negative branch operation while keeping one shared image list and one immutable encoder mapping.