Ace-Step UI Batch Size Parameter: VRAM Limitations and Configuration Guide
The batch size parameter in Ace-Step UI controls how many image variations the language model processes simultaneously, capped at 8 samples to prevent GPU out-of-memory errors on consumer hardware.
Ace-Step UI is an open-source interface for managing language model training and generation workflows. The batch size parameter determines how many samples the model processes in a single forward pass, directly impacting VRAM consumption and throughput. Understanding its limitations is critical for avoiding memory allocation failures on GPUs with limited capacity.
What Is the Batch Size Parameter in Ace-Step UI?
The batch size setting defines how many image variations the language model handles in a single request. This parameter operates in two distinct contexts within the application: model training and inference generation.
Training Context
In the training interface (components/TrainingPanel.tsx), the batch size determines how many samples the model processes per training step. The default value is set at line 150:
// TrainingPanel.tsx – default value
batchSize: 1,
The UI restricts this value to a safe range via a slider component at line 1065, allowing values between 1 and 8. This limit ensures compatibility with standard consumer GPU memory capacities.
Generation Context
During generation (components/CreatePanel.tsx), the batch size multiplies the number of variations produced for each bulk job. The system calculates total variations as bulkCount * batchSize, displaying this value on the generation button at lines 2782-2783. The parameter persists across sessions using the browser's localStorage under the key ace-batchSize (lines 159-160).
VRAM Limitations and Hardware Constraints
The hard ceiling of 8 samples reflects VRAM constraints inherent to consumer-grade hardware. Each increment in batch size allocates additional GPU memory for intermediate activations, gradients, and output buffers.
Key limitations include:
- Linear Memory Scaling: Each additional sample consumes roughly the same amount of VRAM as a single sample. Doubling the batch size from 4 to 8 effectively doubles the memory requirement for that operation.
- Out-of-Memory Risk: Exceeding available VRAM triggers hard crashes rather than graceful degradation. The application provides no automatic fallback mechanism for memory overflow.
- Hardware-Specific Thresholds: The 1-8 range represents a safe upper bound for most supported GPUs. Users should start with
batchSize = 1and increment only after verifying stable memory usage.
Implementation Details and Code Configuration
The codebase enforces these constraints through explicit UI boundaries and persistent state management.
Training Panel Configuration
The training interface initializes with a conservative default and exposes a constrained slider:
// Slider UI in TrainingPanel.tsx (line 1065)
<ParamSlider
label="Batch Size"
value={trainingParams.batchSize}
min={1}
max={8}
step={1}
onChange={v => setTrainingParams(p => ({ ...p, batchSize: v }))}
/>
This configuration prevents users from entering values that would immediately exhaust GPU resources during training loops.
Create Panel Persistence
The generation panel implements recall functionality to restore the last successful configuration:
// CreatePanel.tsx – load persisted value (lines 159-160)
const [batchSize, setBatchSize] = useState(() => {
const stored = localStorage.getItem('ace-batchSize');
return stored ? Number(stored) : 1;
});
// Slider UI maintains same 1-8 limits (line 1348)
<Slider value={batchSize} min={1} max={8} onChange={setBatchSize} />
The final parameter value passes to the backend through App.tsx at line 814, completing the data flow from UI to GPU computation.
Summary
- Batch size controls simultaneous sample processing in both training and generation workflows within Ace-Step UI.
- Hard limit of 8 prevents VRAM exhaustion on consumer hardware, with a default of 1 for safety.
- Memory scales linearly with each increment, risking out-of-memory errors if set too high for available GPU capacity.
- Persistence mechanism stores the generation batch size in
localStorageunderace-batchSizefor session continuity. - Implementation spans
TrainingPanel.tsx(defaults and training slider),CreatePanel.tsx(generation slider and storage), andApp.tsx(backend handoff).
Frequently Asked Questions
What is the maximum batch size allowed in Ace-Step UI?
The maximum batch size is 8, enforced by slider constraints in both TrainingPanel.tsx (line 1065) and CreatePanel.tsx (line 1348). This ceiling protects against VRAM exhaustion on typical consumer GPUs.
Why does increasing batch size cause out-of-memory errors?
Each batch size increment allocates additional GPU memory for model activations and output buffers. Since memory usage scales roughly linearly with batch size, values exceeding your GPU's VRAM capacity trigger immediate allocation failures without automatic fallback mechanisms.
How does Ace-Step UI remember my batch size preference?
For generation tasks, the application persists the batch size value in the browser's localStorage under the key ace-batchSize. This allows the interface to restore your last successful configuration when reloading CreatePanel.tsx, as implemented in the useState initializer at lines 159-160.
Does batch size affect training and generation differently?
Yes. During training, batch size determines how many samples enter each gradient calculation step, directly affecting convergence characteristics. During generation, it multiplies the total output count (bulkCount * batchSize) to produce multiple variations per request, impacting throughput rather than model weights.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →