Archived
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:
1 parent
685ec5bd85
commit
4246a1dd04
124 files changed
+14326
-387
No files matched your search
+26
-3
@@ -39,6 +39,7 @@
|
||||
* special tokens and the prompt without, so a caller cannot write control tokens into it.
|
||||
*/
|
||||
#include "server.h"
|
||||
#include "loras.h"
|
||||
#include "oai.h"
|
||||
|
||||
#include "gen/video.h"
|
||||
@@ -168,7 +169,9 @@ HttpResponse Server::handle_video_create(const HttpRequest& req) {
|
||||
return error_response(err_bad(p.name, "'" + p.name + "' takes text, not a file"),
|
||||
req.peer);
|
||||
json v = p.data;
|
||||
if (p.name == "target" || p.name == "conditions") {
|
||||
if (p.name == "target" || p.name == "conditions" ||
|
||||
((p.name == "loras" || p.name == "lora") && !p.data.empty() &&
|
||||
(p.data[0] == '[' || p.data[0] == '{'))) {
|
||||
v = json::parse(p.data, nullptr, false);
|
||||
if (v.is_discarded())
|
||||
return error_response(err_bad(p.name, "expected JSON"), req.peer);
|
||||
@@ -183,7 +186,7 @@ HttpResponse Server::handle_video_create(const HttpRequest& req) {
|
||||
static const char* kKnown[] = {
|
||||
"model", "prompt", "seconds", "size", "input_reference", "seed", "num_inference_steps",
|
||||
"task", "target", "conditions", "user", "latent_upscale", "upscale_refine_steps",
|
||||
"negative_prompt", "decoder",
|
||||
"negative_prompt", "decoder", "loras", "lora",
|
||||
/* RadVideoGenBatch::guidance_h's order */
|
||||
"guidance_scale", "stg_scale", "modality_scale", "guidance_rescale",
|
||||
"audio_guidance_scale", "audio_stg_scale", "audio_modality_scale", "audio_guidance_rescale",
|
||||
@@ -210,7 +213,17 @@ HttpResponse Server::handle_video_create(const HttpRequest& req) {
|
||||
if (!has(body, "prompt") || !body["prompt"].is_string() ||
|
||||
body["prompt"].get<std::string>().find_first_not_of(" \t\r\n") == std::string::npos)
|
||||
return bad("prompt", "the prompt is required, as a non-empty string");
|
||||
const std::string prompt = body["prompt"].get<std::string>();
|
||||
std::string prompt = body["prompt"].get<std::string>();
|
||||
/* Runtime LoRA adapters: `loras` and <lora:...> tags, which leave the prompt. */
|
||||
std::vector<std::pair<std::string, double>> loras;
|
||||
{
|
||||
std::string field, why;
|
||||
if (parse_loras(body, &prompt, &loras, &field, &why) < 0) return bad(field.c_str(), why);
|
||||
if (!loras.empty() && !opt_.gen_lora_acquire)
|
||||
return error_response(err_unsupported(field.c_str(), "this server was started without "
|
||||
"adapters (--lora, --lora-dir)"),
|
||||
req.peer);
|
||||
}
|
||||
if (has(body, "input_reference")) {
|
||||
/* JSON: a data URL, as a string or an image_url object. */
|
||||
const json& v = body["input_reference"];
|
||||
@@ -497,6 +510,16 @@ HttpResponse Server::handle_video_create(const HttpRequest& req) {
|
||||
}
|
||||
|
||||
/* ---- admitted and queued: the job holds its place until its file is written */
|
||||
if (!loras.empty()) {
|
||||
std::string why, note;
|
||||
const int s = opt_.gen_lora_acquire(loras, &r->lora_slot, &r->lora_hold, ¬e, &why);
|
||||
if (s < 0) {
|
||||
ApiError e = err_bad("loras", why);
|
||||
if (s == RAD_E_NOTFOUND) { e.status = 404; e.type = "not_found_error"; }
|
||||
else if (s != RAD_E_INVAL) { e.status = 503; e.type = "server_error"; }
|
||||
return error_response(e, req.peer);
|
||||
}
|
||||
}
|
||||
if (auto no = admit(1, req.peer)) return *no;
|
||||
auto j = std::make_shared<VideoJob>();
|
||||
j->id = new_video_id();
|
||||
|
||||
Reference in new issue
Block a user