[GH-ISSUE #4] Torch OOM when loading large text sample #4

Open
opened 2026-10-30 21:03:20 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @NullCode1337 on GitHub (Jan 25, 2026).
Original GitHub issue: https://github.com/1038lab/ComfyUI-QwenTTS/issues/4

When trying to load a large video script into text box,
the node fills up the VRAM (and has no offloading to system memory),
after which it says there is no memory available

What should be the correct way to approach this generation?

AILab_Qwen3TTSVoiceDesign
---
Allocation on device 0 would exceed allowed memory. (out of memory)
Currently allocated : 5.19 GiB
Requested : 16.88 MiB
Device limit : 15.48 GiB
Free (according to CUDA): 23.62 MiB
PyTorch limit (set by user-supplied memory fraction)
: 17179869184.00 GiB
This error means you ran out of memory on your GPU.

Using sample workflow with VoiceDesign and everything else bypassed
Image

Originally created by @NullCode1337 on GitHub (Jan 25, 2026). Original GitHub issue: https://github.com/1038lab/ComfyUI-QwenTTS/issues/4 When trying to load a large video script into text box, the node fills up the VRAM (and has no offloading to system memory), after which it says there is no memory available What should be the correct way to approach this generation? ```python AILab_Qwen3TTSVoiceDesign --- Allocation on device 0 would exceed allowed memory. (out of memory) Currently allocated : 5.19 GiB Requested : 16.88 MiB Device limit : 15.48 GiB Free (according to CUDA): 23.62 MiB PyTorch limit (set by user-supplied memory fraction) : 17179869184.00 GiB This error means you ran out of memory on your GPU. ``` Using sample workflow with VoiceDesign and everything else bypassed <img width="1500" height="709" alt="Image" src="https://github.com/user-attachments/assets/39521bba-3fc4-45e5-8381-31720b50df4e" />
Author
Owner

@1038lab commented on GitHub (Jan 30, 2026):

Long scripts can blow up VRAM because TTS generation scales with token length and max_new_tokens.

Recommended approach:

  1. Split long scripts into smaller chunks/paragraphs (e.g. 10–30 seconds per chunk).
  2. Lower max_new_tokens (try 512–2048 depending on chunk length).
  3. Use precision=bf16 on CUDA.
  4. Enable unload_models=True if you’re tight on VRAM.

We also provide Text Token Count (QwenTTS) which can help pick a sensible token cap.

If you tell me:

  • GPU VRAM and model choice (0.6B vs 1.7B)
  • your text length
    I can recommend a safe “chunk size + token cap” recipe.
<!-- gh-comment-id:3821861866 --> @1038lab commented on GitHub (Jan 30, 2026): Long scripts can blow up VRAM because TTS generation scales with token length and `max_new_tokens`. Recommended approach: 1) **Split long scripts** into smaller chunks/paragraphs (e.g. 10–30 seconds per chunk). 2) Lower `max_new_tokens` (try 512–2048 depending on chunk length). 3) Use `precision=bf16` on CUDA. 4) Enable `unload_models=True` if you’re tight on VRAM. We also provide **Text Token Count (QwenTTS)** which can help pick a sensible token cap. If you tell me: - GPU VRAM and model choice (0.6B vs 1.7B) - your text length I can recommend a safe “chunk size + token cap” recipe.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
1038lab/ComfyUI-QwenTTS#4
No description provided.