Archived
LoRA for image and video generators: - civitai and Hugging Face adapter files as published: kohya, ComfyUI and diffusers/PEFT key names; LoRA, LoCon, LoHa, LoKr and full-weight diffs; DoRA, OFT and Tucker are refused by name - stacked per request with a strength each, through the `loras` field or <lora:name:strength> tags in the prompt; --lora-dir serves every file in a directory, GET /v1/loras lists them, and --max-loras / --max-lora-rank size the slots on the card (generators default to rank 64) - Krea 2, Qwen-Image 2.1, FLUX.3 [klein], MiniMax H3, LTX-2.5, Anima and SDXL New models: - Anima (base, aesthetic and turbo): Cosmos-Predict2 DiT with the Qwen3-0.6B text encoder and the Qwen-Image VAE, on one card - Stable Diffusion XL and its single-file finetunes (Illustrious, NoobAI including V-Pred, Pony), read as civitai ships them, with the Euler, Euler a and DPM++ 2M samplers Recipes: - q38-27b-mxfp4-df2: any bf16 Qwen3.8-27B or finetune at MXFP4 with the DFlash2 drafter - Krea 2 finetunes from civitai: scripts/krea2_native.py reads Krea's own key names, and krea-2-fp8-unscaled keeps a plain-fp8 file's codes exactly Changes: --max-num-batched-tokens defaults to 2048 (was 8192). Plugin ABI 25: out-of-tree plugins must be rebuilt.
31 lines
1.1 KiB
C++
31 lines
1.1 KiB
C++
/* loras.h -- which runtime LoRA adapters an image or video request asks for, and at what strength.
|
|
*
|
|
* Two spellings, merged:
|
|
*
|
|
* `loras` in the body: a list whose entries are a name, "name:strength", or an object
|
|
* {"name": ..., "weight" | "strength" | "scale": ...}; or an object {name: strength}.
|
|
* `lora` is the same field.
|
|
*
|
|
* <lora:name> or <lora:name:strength> in the prompt, as Stable Diffusion web UIs write it: the
|
|
* tag is taken out of the prompt, the text around it kept.
|
|
*
|
|
* A strength not given is 1. */
|
|
#pragma once
|
|
#include <nlohmann/json.hpp>
|
|
|
|
#include <string>
|
|
#include <utility>
|
|
#include <vector>
|
|
|
|
namespace rad {
|
|
namespace server {
|
|
|
|
/* RAD_OK with the adapters in `out` (possibly none) and their tags removed from *prompt;
|
|
* RAD_E_INVAL with `why` for a malformed entry. `field` receives the field the error is about. */
|
|
int parse_loras(const nlohmann::json& body, std::string* prompt,
|
|
std::vector<std::pair<std::string, double>>* out, std::string* field,
|
|
std::string* why);
|
|
|
|
} /* namespace server */
|
|
} /* namespace rad */
|