Media Gen SolutionCustomizations

LoRAs

LoRAs for image or video AI models are custom weights applied to a base checkpoint. LoRAs are a way to make highly customized AI images or videos.

LoRAs are additional custom weights applied to a base checkpoint. Similar to checkpoints, LoRAs can represent a specific style or custom subject, but they are much smaller in size and more economical to use. You can include multiple LoRAs in a single image generation, and provide a weight for each LoRA. A greater weight value will have more influence on the generated image. Similar to checkpoints, users have the flexibility to import LoRAs from external sources, and integrate them seamlessly into OctoAI’s Asset Library as personalized assets.

Below is an example of using a LoRA along with a simple prompt Commercial photography,snowy,luxury perfume bottle,angelic silver light, studio light, high resolution photography, fine details. You can see the results from the SDXL base model (top left) and subsequent results with add-detail LoRA - varying weights (top right and bottom left). Add-details LoRA adds intricate details to the output image. The image generated on the botton right is a result of two LoRAs, add-details (weight:0.3) and more-art (weight:1.0). More-art LoRA adds artistic details to the output image. You can clearly see the impact of more-art LoRA over add-detail LoRA in the resulting image.

Using SDXL without LoRA

Using add-detail LoRA:0.5

Using add-detail LoRA:1.0

add-detail:0.3, more-art LoRA:1.0

Example Code:

$curl -X POST "https://image.octoai.run/generate/sdxl" \
> -H "Content-Type: application/json" \
> -H "Authorization: Bearer $OCTOAI_TOKEN" \
> --data-raw '{
> "prompt": "Commercial photography,snowy,luxury perfume bottle,angelic silver light, studio light, high resolution photography, fine details",
> "negative_prompt": "Blurry photo, distortion, low-res, poor quality",
> "loras": {
> "octoai:add-detail": 0.3,
> "octoai:more_art": 1
> },
> "width": 1024,
> "height": 1024,
> "num_images": 1,
> "sampler": "DDIM",
> "steps": 30,
> "cfg_scale": 12,
> "use_refiner": true,
> "high_noise_frac": 0.8,
> "style_preset": "base"
> }' | jq -r ".images[0].image_b64" | base64 -d >result.jpg

LoRAs can further customize your images, by including custom objects or styles.