Files
endman100 453c5b277f Add ComfyUI SGLang Diffusion plugin
Introduce a new ComfyUI plugin to integrate SGLang Diffusion. Adds core integration pieces (generator, model patcher, server API client), executor implementations for multiple model types (flux, qwen_image, zimage, native, anima), node mappings, utilities, example workflows, and tests. Includes README with installation/usage instructions and example workflow JSON files. This commit implements both server (HTTP) and integrated modes, model loading/patching logic, and basic LoRA/video/image API support.
2026-04-17 21:10:38 +08:00

26 lines
987 B
Python

"""
Anima native executor for SGLang Diffusion ComfyUI integration.
Extends NativeExecutor to add preprocess_text_embeds support
required by model_base.Anima.extra_conds().
"""
from .native import NativeExecutor
class AnimaExecutor(NativeExecutor):
"""Native executor for Anima models.
Extends NativeExecutor to expose preprocess_text_embeds,
which model_base.Anima.extra_conds() calls before the forward pass.
"""
def __init__(self, generator, model_path, model, config, native_diffusion_model):
super().__init__(generator, model_path, model, config, native_diffusion_model)
# Expose preprocess_text_embeds so model_base.Anima.extra_conds() can call it
self.preprocess_text_embeds = native_diffusion_model.preprocess_text_embeds
def forward(self, x, timesteps, context, **kwargs):
"""Forward pass: delegate directly to the ComfyUI Anima model."""
return self.native_diffusion_model(x, timesteps, context, **kwargs)