Apolo
HomeConsoleGitHub
  • Apolo concepts
  • CLI Reference
  • Examples/Use Cases
  • Flow CLI
  • Actions Reference
  • Apolo Extras CLI
  • Python SDK
  • Enterprise-Ready Generative AI Applications
    • Apolo Documentation Chatbot
    • Canada Budget RAG
  • Visual RAG on Complex PDFs: Enterprise-Ready Multimodal AI
    • Architecture Overview
    • Implementation
  • Generic
    • ML Model Lifecycle on Apolo Platform
      • End-to-End ML Model Lifecycle using Apolo CLI
      • ML Model Lifecycle using Apolo Console
  • Large language models
    • DeepSeek-R1 distilled models
    • DeepSeek-R1 model deployment
    • Teaching Models To Reason - Training, Fine-Tuning, and Evaluating Models with LLaMA Factory on Apolo
    • Autonomous Research with AgentLaboratory: DeepSeek R1 vs. OpenAI o1
  • Image and Video processing
    • Synthetic Data Generation using Stable Diffusion
    • HOWTO: Lora models with Stable Diffusion
  • Audio Processing
    • Deploying Text-to-Speech and Speech-to-Text Models in Apolo
Powered by GitBook
On this page
  • What is LoRA (Low-Rank Adaptation)?
  • How to Use LoRA in Apolo platform with Stable Diffusion
  • Lora model
  • References:

Was this helpful?

  1. Image and Video processing

HOWTO: Lora models with Stable Diffusion

PreviousSynthetic Data Generation using Stable DiffusionNextDeploying Text-to-Speech and Speech-to-Text Models in Apolo

Last updated 2 months ago

Was this helpful?

What is LoRA (Low-Rank Adaptation)?

LoRA, short for Low-Rank Adaptation, is a technique used to fine-tune large AI models (like language or vision models) efficiently and with fewer resources.

Instead of updating all the parameters in a massive pre-trained model—which is expensive and memory-intensive—LoRA freezes the original model and adds small, trainable layers (called low-rank matrices) to specific parts of the model (like attention layers). These additions learn the task-specific changes, allowing the core model to remain unchanged.

Using LoRA models with Stable Diffusion is a super popular way to customize the style, character, or theme of your image generations without retraining the whole model.

How to Use LoRA in Apolo platform with Stable Diffusion

Prerequisites:

  • Install Apolo cli using doc

  • Clone repo

Add secret value with personal Hugging Face Token

apolo secret add HF_TOKEN <your_token>

Run Stable Diffusion job, replacing the secret value, preset, and any other configuration

apolo-flow run stablediffusion

Download the model using SDnext interface

Go to Models -> HuggingFace

Generate the first image:

Prompt:

Ghibli style futuristic stormtrooper with glossy white armor and a sleek helmet, standing heroically on a lush alien planet, vibrant flowers blooming around, soft sunlight illuminating the scene, a gentle breeze rustling the leaves

Lora model

Let's find a trained model on Civit.ai, we need to filter model by our Stable Diffusion version.

Alternative can be HuggingFace search. (tags: Lora, Stable Diffusion, 3.5)

Now we need to copy our model into the /Lora directory of our storage volume

apolo cp -r studio-ghibli-style-lora.safetensors storage:sdnext/models/Lora/studio-ghibli-style-lora.safetensors

After Model Copying, and hitting the refresh button on the Lora tab, we should be able to see our model downloaded.

Click on your Networks -> Lora tab, hit refresh, and click on your Lora model, that will add Lora to youre prompt, and you will be able to generate images using it.

For example we generated ghibli-style stormtrooper.

References:

I will use "" Lora model.

studio-ghibli-style-lora
Apolo cli
SDnext repository
Apolo secrets cli documentation
Civit AI model storage
this
this
HuggingFace model download interface
Civit.AI search models interface
Ghibli style stormtrooper