How to Configure a LoRA Model in ImageStudio's Advanced Options
To configure a LoRA model in ImageStudio, open the Advanced panel, enter a Civitai LoRA ID in the format civitai:<model_id>@<version>, set the weight between 0 and 4, and click Generate.
The Open-Generative-AI repository by Anil-matcha provides ImageStudio, a web interface for Flux-based image generation with extensible parameter controls. Configuring a LoRA model within ImageStudio's advanced options enables you to apply specialized Low-Rank Adaptation weights from Civitai to fine-tune your generation results.
Accessing the Advanced Configuration Panel
The LoRA configuration controls reside in the Advanced panel, which is hidden by default when you load ImageStudio. To reveal these options, click the Advanced button (labeled "Show advanced options") in the interface.
According to the source in src/components/ImageStudio.js (lines 362-384), this toggle controls the visibility of the #advanced-panel DOM element. Once expanded, the panel exposes all extended generation parameters, including the dedicated LoRA input fields.
Entering the LoRA Model Identifier
Within the Advanced panel, locate the LoRA Model (optional) text input field identified as #lora-input (lines 672-674 in src/components/ImageStudio.js). This field expects a specific string format to reference Civitai-hosted models.
Enter the LoRA identifier using this exact schema:
civitai:<model_id>@<version>
For example: civitai:1642876@1864626. The validation and description for this format are defined in src/lib/models.js (lines 117-128), where the JSON schema specifies the expected Civitai ID structure. This schema is duplicated in packages/studio/src/models.js (lines 104-128) to maintain consistency between the library and the packaged Studio application.
Setting the LoRA Weight
Immediately below the model ID field is the LoRA Weight numeric input (#lora-weight-input, lines 680-682 in src/components/ImageStudio.js). This parameter accepts values ranging from 0 to 4, determining the strength of the LoRA's influence during image generation.
The weight value you select is passed directly to the Flux-Dev backend as a float in the generation payload.
Request Payload Structure
When you initiate generation, ImageStudio automatically constructs a JSON payload that incorporates your LoRA configuration. The values from #lora-input and #lora-weight-input are mapped to the lora array as defined by the schema in src/lib/models.js.
The resulting API request body looks like this:
{
"prompt": "a futuristic cityscape at sunset",
"width": 1024,
"height": 1024,
"steps": 30,
"guidance": 7.5,
"lora": [
{
"id": "civitai:1642876@1864626",
"weight": 2.5
}
]
}
The lora array contains objects with id and weight properties, reflecting exactly what you configured in the Advanced panel. The backend processes this array to apply the specified adaptations during inference.
Summary
- Click the Advanced button to reveal the hidden panel in
src/components/ImageStudio.js(lines 362-384). - Enter the Civitai LoRA ID in
civitai:<model_id>@<version>format in the#lora-inputfield (lines 672-674). - Adjust the LoRA Weight between 0 and 4 using the
#lora-weight-inputcontrol (lines 680-682). - The configuration is automatically serialized into the
loraarray of the generation request as specified insrc/lib/models.js.
Frequently Asked Questions
What is the correct format for a Civitai LoRA ID?
The required format is civitai:<model_id>@<version>, for example civitai:1642876@1864626. This schema is strictly enforced by the validation logic in src/lib/models.js (lines 117-128) and mirrored in packages/studio/src/models.js to ensure the UI and API share a single source of truth.
What LoRA weight values are supported in ImageStudio?
ImageStudio supports LoRA weight values ranging from 0 to 4. The numeric input field #lora-weight-input in src/components/ImageStudio.js (lines 680-682) accepts values within this range to control the intensity of the LoRA effect on the generated image.
Where is the LoRA configuration implemented in the codebase?
The frontend implementation resides in src/components/ImageStudio.js, specifically targeting the #lora-input and #lora-weight-input DOM elements. The request schema that validates this data is defined in src/lib/models.js and duplicated in packages/studio/src/models.js for the packaged distribution.
Can I use multiple LoRA models simultaneously?
Yes, the underlying API supports multiple LoRA entries. The request payload accepts a lora array where each object contains an id and weight, as defined in src/lib/models.js. While the standard UI provides fields for a single LoRA configuration, the schema explicitly describes this property as a list, allowing multiple models to be applied in a single generation request.
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 →