radiance 1.10.0

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.
This commit is contained in:
Deadcode committed 2026-10-20 21:05:16 +02:00
1 parent 685ec5bd85
commit 4246a1dd04
124 files changed
+14326 -387

No files matched your search

+24
View File
@@ -19,12 +19,14 @@
#include "../rad_core.h"
#include <cstdint>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <vector>
namespace rad {
struct StTensor;
namespace lora {
/* HF module leaf names, ordered so every caller builds the same set. Empty targets nothing. */
@@ -82,6 +84,8 @@ struct PackedSite {
std::vector<float> scale; /* [N_r]: the module's alpha/r (alpha/sqrt(r) rsLoRA) on its rows */
int32_t pool = -1;
bool empty = true; /* no module of this adapter lands in this pool */
/* Packed compact (pack_modules): the ranks the modules take, from j = 0; R otherwise. */
int64_t r_used = 0;
};
/* What an adapter is, independent of the name it is served under. */
@@ -157,6 +161,26 @@ int build_sites(const Program& prog, const TargetSet& targets, int max_rank,
int load_adapter(const std::string& dir, const std::vector<Site>& sites, int max_rank,
AdapterInfo* info, std::vector<PackedSite>* packed, std::string* err);
/* One module's factors as the packer reads them: lora_A [rank, K] and lora_B [rows, rank] in any
* dtype a safetensors tensor carries (BF16, F16, F32), and the scale its rows run at. `name` is the
* module path the base's name map spells (without ".weight"). */
struct AdModule {
std::string name;
const StTensor* A = nullptr;
const StTensor* B = nullptr;
int64_t rank = 0;
double alpha = 0.0;
float scale = 0.0f;
};
/* load_adapter's second half, for any source of factors: `mods` (by name) packed into one
* PackedSite per pool of `sites`, in the slot layout of the pool's sites. Fills info->modules and
* info->absent. `compact`: the modules of a pool take consecutive ranks from j = 0, in source
* order, instead of a block of max_rank each, so a pass may run only the first r_used of them. */
int pack_modules(const std::vector<Site>& sites, int max_rank,
const std::map<std::string, AdModule>& mods, AdapterInfo* info,
std::vector<PackedSite>* packed, std::string* err, bool compact = false);
/* After load_adapter on every rank: refuse a module that no rank placed. With `prog`/`targets`
* (any one rank's) the message says why it is not a site (base lacks it, scope, target list, op). */
int check_placed(const std::vector<AdapterInfo>& per_rank, std::string* err,