feat: add memory-optimized startup script for Qwen-Image

Created run_qwen_optimized.sh script that:
- Sets optimal CUDA memory allocation settings
- Configures cache sizes for 24GB VRAM systems
- Uses bfloat16 precision by default
- Includes helpful recommendations for users

This script helps users avoid OOM errors when running Qwen-Image models
on systems with limited VRAM.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
psychedelicious
2025-09-09 19:36:48 +10:00
parent 337906968e
commit 14b335d42f

26
run_qwen_optimized.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/bash
# Run InvokeAI with optimized settings for Qwen-Image models
echo "Starting InvokeAI with Qwen-Image memory optimizations..."
echo "----------------------------------------"
echo "Recommendations for 24GB VRAM systems:"
echo "1. Set VRAM cache to 8-10GB in InvokeAI settings"
echo "2. Set RAM cache to 20-30GB (based on available system RAM)"
echo "3. Use bfloat16 precision (default in our loader)"
echo "----------------------------------------"
# Set environment variables for better memory management
export PYTORCH_CUDA_ALLOC_CONF="max_split_size_mb:512"
export CUDA_LAUNCH_BLOCKING=0
# Optional: Limit CPU threads to prevent memory thrashing
export OMP_NUM_THREADS=8
# Run InvokeAI with your root directory
invokeai-web --root ~/invokeai/ \
--precision bfloat16 \
--max_cache_size 8.0 \
--max_vram_cache_size 8.0
# Alternative: Use with config file
# invokeai-web --root ~/invokeai/ --config qwen_test_config.yaml