Add LM Backend selector (PT vs VLLM) to reduce VRAM usage
PT backend uses ~1.6 GB VRAM vs ~9.2 GB for VLLM, making it accessible on lower-end GPUs. Adds dropdown in Advanced Settings defaulting to PT.
This commit is contained in:
@@ -596,6 +596,7 @@ export default function App() {
|
|||||||
lmTopK: params.lmTopK,
|
lmTopK: params.lmTopK,
|
||||||
lmTopP: params.lmTopP,
|
lmTopP: params.lmTopP,
|
||||||
lmNegativePrompt: params.lmNegativePrompt,
|
lmNegativePrompt: params.lmNegativePrompt,
|
||||||
|
lmBackend: params.lmBackend,
|
||||||
referenceAudioUrl: params.referenceAudioUrl,
|
referenceAudioUrl: params.referenceAudioUrl,
|
||||||
sourceAudioUrl: params.sourceAudioUrl,
|
sourceAudioUrl: params.sourceAudioUrl,
|
||||||
audioCodes: params.audioCodes,
|
audioCodes: params.audioCodes,
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ export const CreatePanel: React.FC<CreatePanelProps> = ({ onGenerate, isGenerati
|
|||||||
const [audioFormat, setAudioFormat] = useState<'mp3' | 'flac'>('mp3');
|
const [audioFormat, setAudioFormat] = useState<'mp3' | 'flac'>('mp3');
|
||||||
const [inferenceSteps, setInferenceSteps] = useState(8);
|
const [inferenceSteps, setInferenceSteps] = useState(8);
|
||||||
const [inferMethod, setInferMethod] = useState<'ode' | 'sde'>('ode');
|
const [inferMethod, setInferMethod] = useState<'ode' | 'sde'>('ode');
|
||||||
|
const [lmBackend, setLmBackend] = useState<'pt' | 'vllm'>('pt');
|
||||||
const [shift, setShift] = useState(3.0);
|
const [shift, setShift] = useState(3.0);
|
||||||
|
|
||||||
// LM Parameters (under Expert)
|
// LM Parameters (under Expert)
|
||||||
@@ -535,6 +536,7 @@ export const CreatePanel: React.FC<CreatePanelProps> = ({ onGenerate, isGenerati
|
|||||||
thinking,
|
thinking,
|
||||||
audioFormat,
|
audioFormat,
|
||||||
inferMethod,
|
inferMethod,
|
||||||
|
lmBackend,
|
||||||
shift,
|
shift,
|
||||||
lmTemperature,
|
lmTemperature,
|
||||||
lmCfgScale,
|
lmCfgScale,
|
||||||
@@ -1298,6 +1300,20 @@ export const CreatePanel: React.FC<CreatePanelProps> = ({ onGenerate, isGenerati
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* LM Backend */}
|
||||||
|
<div className="space-y-1.5">
|
||||||
|
<label className="text-xs font-medium text-zinc-600 dark:text-zinc-400">LM Backend</label>
|
||||||
|
<select
|
||||||
|
value={lmBackend}
|
||||||
|
onChange={(e) => setLmBackend(e.target.value as 'pt' | 'vllm')}
|
||||||
|
className="w-full bg-zinc-50 dark:bg-black/20 border border-zinc-200 dark:border-white/10 rounded-lg px-2 py-1.5 text-xs text-zinc-900 dark:text-white focus:outline-none"
|
||||||
|
>
|
||||||
|
<option value="pt">PT (~1.6 GB VRAM)</option>
|
||||||
|
<option value="vllm">VLLM (~9.2 GB VRAM)</option>
|
||||||
|
</select>
|
||||||
|
<p className="text-[10px] text-zinc-500">PT uses less VRAM, VLLM may be faster on powerful GPUs</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* Seed */}
|
{/* Seed */}
|
||||||
<div className="space-y-2">
|
<div className="space-y-2">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-center justify-between">
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ interface GenerateBody {
|
|||||||
lmTopK?: number;
|
lmTopK?: number;
|
||||||
lmTopP?: number;
|
lmTopP?: number;
|
||||||
lmNegativePrompt?: string;
|
lmNegativePrompt?: string;
|
||||||
|
lmBackend?: 'pt' | 'vllm';
|
||||||
|
|
||||||
// Expert Parameters
|
// Expert Parameters
|
||||||
referenceAudioUrl?: string;
|
referenceAudioUrl?: string;
|
||||||
@@ -189,6 +190,7 @@ router.post('/', authMiddleware, async (req: AuthenticatedRequest, res: Response
|
|||||||
lmTopK,
|
lmTopK,
|
||||||
lmTopP,
|
lmTopP,
|
||||||
lmNegativePrompt,
|
lmNegativePrompt,
|
||||||
|
lmBackend,
|
||||||
referenceAudioUrl,
|
referenceAudioUrl,
|
||||||
sourceAudioUrl,
|
sourceAudioUrl,
|
||||||
audioCodes,
|
audioCodes,
|
||||||
@@ -252,6 +254,7 @@ router.post('/', authMiddleware, async (req: AuthenticatedRequest, res: Response
|
|||||||
lmTopK,
|
lmTopK,
|
||||||
lmTopP,
|
lmTopP,
|
||||||
lmNegativePrompt,
|
lmNegativePrompt,
|
||||||
|
lmBackend,
|
||||||
referenceAudioUrl,
|
referenceAudioUrl,
|
||||||
sourceAudioUrl,
|
sourceAudioUrl,
|
||||||
audioCodes,
|
audioCodes,
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ async function submitToApi(params: GenerationParams): Promise<{ taskId: string }
|
|||||||
use_cot_caption: false, // Explicitly disable CoT features that require LLM
|
use_cot_caption: false, // Explicitly disable CoT features that require LLM
|
||||||
use_cot_language: false, // Explicitly disable CoT features that require LLM
|
use_cot_language: false, // Explicitly disable CoT features that require LLM
|
||||||
use_cot_metas: false, // Explicitly disable CoT features that require LLM
|
use_cot_metas: false, // Explicitly disable CoT features that require LLM
|
||||||
|
lm_backend: params.lmBackend || 'pt',
|
||||||
};
|
};
|
||||||
|
|
||||||
if (params.bpm && params.bpm > 0) body.bpm = params.bpm;
|
if (params.bpm && params.bpm > 0) body.bpm = params.bpm;
|
||||||
@@ -150,7 +151,12 @@ async function submitToApi(params: GenerationParams): Promise<{ taskId: string }
|
|||||||
if (params.audioCodes) body.audio_code_string = params.audioCodes;
|
if (params.audioCodes) body.audio_code_string = params.audioCodes;
|
||||||
if (params.repaintingStart !== undefined && params.repaintingStart > 0) body.repainting_start = params.repaintingStart;
|
if (params.repaintingStart !== undefined && params.repaintingStart > 0) body.repainting_start = params.repaintingStart;
|
||||||
if (params.repaintingEnd !== undefined && params.repaintingEnd > 0) body.repainting_end = params.repaintingEnd;
|
if (params.repaintingEnd !== undefined && params.repaintingEnd > 0) body.repainting_end = params.repaintingEnd;
|
||||||
if (params.audioCoverStrength !== undefined && params.audioCoverStrength !== 1.0) body.audio_cover_strength = params.audioCoverStrength;
|
// Always send audio_cover_strength for cover/repaint tasks, otherwise only when not default
|
||||||
|
if (params.taskType === 'cover' || params.taskType === 'repaint' || params.sourceAudioUrl) {
|
||||||
|
body.audio_cover_strength = params.audioCoverStrength ?? 1.0;
|
||||||
|
} else if (params.audioCoverStrength !== undefined && params.audioCoverStrength !== 1.0) {
|
||||||
|
body.audio_cover_strength = params.audioCoverStrength;
|
||||||
|
}
|
||||||
if (params.instruction) body.instruction = params.instruction;
|
if (params.instruction) body.instruction = params.instruction;
|
||||||
// LLM and CoT parameters only sent when thinking mode is enabled
|
// LLM and CoT parameters only sent when thinking mode is enabled
|
||||||
if (params.thinking) {
|
if (params.thinking) {
|
||||||
@@ -340,6 +346,7 @@ export interface GenerationParams {
|
|||||||
lmTopK?: number;
|
lmTopK?: number;
|
||||||
lmTopP?: number;
|
lmTopP?: number;
|
||||||
lmNegativePrompt?: string;
|
lmNegativePrompt?: string;
|
||||||
|
lmBackend?: 'pt' | 'vllm';
|
||||||
|
|
||||||
// Expert Parameters
|
// Expert Parameters
|
||||||
referenceAudioUrl?: string;
|
referenceAudioUrl?: string;
|
||||||
@@ -603,7 +610,12 @@ async function processGeneration(
|
|||||||
if (params.audioCodes) args.push('--audio-codes', params.audioCodes);
|
if (params.audioCodes) args.push('--audio-codes', params.audioCodes);
|
||||||
if (params.repaintingStart !== undefined && params.repaintingStart > 0) args.push('--repainting-start', String(params.repaintingStart));
|
if (params.repaintingStart !== undefined && params.repaintingStart > 0) args.push('--repainting-start', String(params.repaintingStart));
|
||||||
if (params.repaintingEnd !== undefined && params.repaintingEnd > 0) args.push('--repainting-end', String(params.repaintingEnd));
|
if (params.repaintingEnd !== undefined && params.repaintingEnd > 0) args.push('--repainting-end', String(params.repaintingEnd));
|
||||||
if (params.audioCoverStrength !== undefined && params.audioCoverStrength !== 1.0) args.push('--audio-cover-strength', String(params.audioCoverStrength));
|
// Always send audio_cover_strength for cover/repaint tasks, otherwise only when not default
|
||||||
|
if (params.taskType === 'cover' || params.taskType === 'repaint' || params.sourceAudioUrl) {
|
||||||
|
args.push('--audio-cover-strength', String(params.audioCoverStrength ?? 1.0));
|
||||||
|
} else if (params.audioCoverStrength !== undefined && params.audioCoverStrength !== 1.0) {
|
||||||
|
args.push('--audio-cover-strength', String(params.audioCoverStrength));
|
||||||
|
}
|
||||||
if (params.instruction) args.push('--instruction', params.instruction);
|
if (params.instruction) args.push('--instruction', params.instruction);
|
||||||
if (params.thinking) args.push('--thinking');
|
if (params.thinking) args.push('--thinking');
|
||||||
if (params.lmTemperature !== undefined) args.push('--lm-temperature', String(params.lmTemperature));
|
if (params.lmTemperature !== undefined) args.push('--lm-temperature', String(params.lmTemperature));
|
||||||
@@ -611,6 +623,7 @@ async function processGeneration(
|
|||||||
if (params.lmTopK !== undefined && params.lmTopK > 0) args.push('--lm-top-k', String(params.lmTopK));
|
if (params.lmTopK !== undefined && params.lmTopK > 0) args.push('--lm-top-k', String(params.lmTopK));
|
||||||
if (params.lmTopP !== undefined) args.push('--lm-top-p', String(params.lmTopP));
|
if (params.lmTopP !== undefined) args.push('--lm-top-p', String(params.lmTopP));
|
||||||
if (params.lmNegativePrompt) args.push('--lm-negative-prompt', params.lmNegativePrompt);
|
if (params.lmNegativePrompt) args.push('--lm-negative-prompt', params.lmNegativePrompt);
|
||||||
|
if (params.lmBackend) args.push('--lm-backend', params.lmBackend);
|
||||||
if (params.useCotMetas === false) args.push('--no-cot-metas');
|
if (params.useCotMetas === false) args.push('--no-cot-metas');
|
||||||
if (params.useCotCaption === false) args.push('--no-cot-caption');
|
if (params.useCotCaption === false) args.push('--no-cot-caption');
|
||||||
if (params.useCotLanguage === false) args.push('--no-cot-language');
|
if (params.useCotLanguage === false) args.push('--no-cot-language');
|
||||||
|
|||||||
@@ -232,6 +232,7 @@ export interface GenerationParams {
|
|||||||
lmTopK?: number;
|
lmTopK?: number;
|
||||||
lmTopP?: number;
|
lmTopP?: number;
|
||||||
lmNegativePrompt?: string;
|
lmNegativePrompt?: string;
|
||||||
|
lmBackend?: 'pt' | 'vllm';
|
||||||
|
|
||||||
// Expert Parameters
|
// Expert Parameters
|
||||||
referenceAudioUrl?: string;
|
referenceAudioUrl?: string;
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ export interface GenerationParams {
|
|||||||
lmTopK: number;
|
lmTopK: number;
|
||||||
lmTopP: number;
|
lmTopP: number;
|
||||||
lmNegativePrompt: string;
|
lmNegativePrompt: string;
|
||||||
|
lmBackend?: 'pt' | 'vllm';
|
||||||
|
|
||||||
// Expert Parameters
|
// Expert Parameters
|
||||||
referenceAudioUrl?: string;
|
referenceAudioUrl?: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user