ComfyUI-Qwen-TeleStyle

This custom node pack reproduces /home/linkray/TeleStyleV2/app.py's style-transfer pipeline as native ComfyUI nodes. It does not depend on that project's directory or its separate venv - weights are read directly from ComfyUI's own model folders.

Nodes:

  • Qwen TeleStyle Loader - pick an architecture (2509 or 2511), a device, and an offload_mode. Resolves (downloading from HuggingFace if missing) the transformer, text encoder, VAE, and the two TeleStyleV2 LoRAs, builds the pipeline once, and outputs it as a TELESTYLE_MODELS socket.
  • Qwen TeleStyle Loader (Shared VAE Experimental) - same as above, but reuses an upstream Comfy VAE object for encode/decode instead of instantiating TeleStyle's own VAE module. This is opt-in and intended for careful testing; the default loader remains the reference path.
  • Qwen TeleStyle Apply - takes that models socket plus content_ref/style_ref images and the usual generation controls (prompt, seed, cfg, steps, minedge, infer_with_content_prompt/infer_with_style_prompt). Its generation logic is app.py's infer() line-for-line, including outputting the generated content_prompt/style_prompt captions as their own STRING sockets (wire these into a text-display node to see them - ComfyUI has no Gradio-style auto-filled textbox).
  • Qwen TeleStyle Unload - frees the cached pipeline.

Expected files (auto-downloaded on first use if missing):

  • transformer (2509): models/diffusion_models/Qwen-Image-Edit-2509.safetensors - pulled as a single pre-merged file from troopa/Qwen-Image-Edit-2509.
  • transformer (2511): models/diffusion_models/Qwen-Image-Edit-2511.safetensors - pulled as a single pre-merged file from troopa/Qwen-Image-Edit-2511.
  • text encoder: models/text_encoders/qwen_2.5_vl_7b.safetensors (shared across architectures)
  • vae: models/vae/qwen_image_vae.safetensors (shared across architectures)
  • style LoRA: models/loras/diffusers-TeleStyleV2-QIE-2509-Lora-bf16.safetensors (or -2511)
  • speed LoRA: models/loras/QIE-2509-Lightning-4steps-V1.0-bf16.safetensors (or -2511)

Each weight file is loaded once, directly into this pipeline's own modules - no ComfyUI MODEL/CLIP/VAE objects are involved. An earlier version bridged live comfy MODEL/CLIP/VAE sockets instead; that duplicated the ~54GB checkpoint in memory (once as comfy's own resident copy, once as this pipeline's independent copy) and reliably OOM-killed ComfyUI on boxes with much less system RAM than VRAM (e.g. 62GB RAM vs 97GB VRAM here) - this version avoids that architecture entirely.

infer_with_content_prompt/infer_with_style_prompt (the Qwen-VL prompt-enhancer) work here because the text encoder file loaded includes lm_head - a live comfy CLIP object never carries it (comfy only keeps the LLM for conditioning, not generation).

Loader offload_mode options:

  • keep_loaded - current behavior: keep the whole TeleStyle pipeline resident on the selected device.
  • model_cpu_offload - let diffusers move whole modules between CPU and the selected device.
  • sequential_cpu_offload - more aggressive offload, usually lower VRAM and slower.

The loader now returns a structured TELESTYLE_MODELS runtime handle internally instead of a bare pipeline object. Qwen TeleStyle Apply still accepts that socket the same way in the graph, but the refactor makes it easier to add future non-standalone runtime modes.

Experimental shared-VAE notes:

  • This only attempts to share the VAE. The transformer and text path remain TeleStyle-owned.
  • The default Qwen TeleStyle Loader path is still the reference implementation for output stability.
  • Use the experimental loader only when the workflow already has the matching Qwen/Wan VAE resident and you want to trade some certainty for lower duplicated residency.
S
Description
No description provided
Readme
5.6 MiB
Languages
Python 95.2%
Jinja 4.2%
JavaScript 0.6%