Run this model with HF Jobs
Run MATLOWAI/MOSS-Image-SFT-DeBand on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/MATLOWAI/MOSS-Image-SFT-DeBand. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/MATLOWAI/MOSS-Image-SFT-DeBand on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use MATLOWAI/MOSS-Image-SFT-DeBand with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusion Single File
How to use MATLOWAI/MOSS-Image-SFT-DeBand with Diffusion Single File:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Add outcome and efficiency benchmarks to edit anatomy
Browse files12 unmodified lines131415161718196 unmodified lines26272829303132333472 unmodified lines1071081091101111121133 unmodified lines11711811912012112212312 unmodified linesARMS = [("solve_rho0.1", "Gram solve Ο=0.1", 1, "solve_mu0_rho0.1_L21-41"),("solve_rho1", "Gram solve Ο=1", 2, "solve_mu0_rho1_L21-41"),("kijai_m1", "Kijai LoRA @ β1", 3, "kijai_m1"),("kijai_m05", "Kijai LoRA @ β0.5", 7, "kijai_m05"),("revert21", "Exact revert 21β41", 4, "solve_mu0_L21-41"),("revert32", "Quality+ (revert 32β41)", 5, "qualityplus_lora"),("revert37", "DeBand (revert 37β41)", 6, "deband_lora")]6 unmodified linesdef edit(r, arm, centred=False):"""The arm's numbers for one linear, or None where it does not edit."""if arm == "kijai_m05": # half strength: energies x 0.25, alignment x 0.5k = r.get("kijai_m1")return k and {key: v / (2 if key == "dot" else 4) for key, v in k.items()}if centred and arm in CKPT:return r.get(CKPT[arm])if arm in RANGES:72 unmodified lines# chart 3: per-layer output-change size on solids vs general promptssel = {}for key in ("solve_rho0.1", "solve_rho1", "kijai_m1"):sel[key] = {"solid": [], "gen": []}for L in glayers:rs = [by[(L, p)] for p in PROJ]3 unmodified linessel[key]["solid"].append(ratio(sum(e[f] for e in es if e), sum(r["revert"][f] for r in rs)))sel[key]["gen"].append(ratio(sum(e[g] for e in es if e), sum(r["revert"][g] for r in rs)))data = {"arms": [[k, l, s] for k, l, s, _ in ARMS], "layers": layers, "size": size, "per_matrix": per_matrix,"sweep": sweep, "points": points, "plain": plain, "glayers": glayers, "sel": sel, "centred": centred}html = open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "anatomy_template.html")).read()open(os.path.join(OUT, "edit_anatomy.html"), "w").write(html.replace("__DATA__", json.dumps(data, ensure_ascii=False)))12 unmodified lines13141516171819206 unmodified lines272829303132333435363772 unmodified lines1101111121131141151163 unmodified lines12012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515612 unmodified linesARMS = [("solve_rho0.1", "Gram solve Ο=0.1", 1, "solve_mu0_rho0.1_L21-41"),("solve_rho1", "Gram solve Ο=1", 2, "solve_mu0_rho1_L21-41"),("kijai_m1", "Kijai LoRA @ β1", 3, "kijai_m1"),("strong", "DeBand Strong @1.0", 7, "strong_full"),("nynxz", "nynxz Destripe @1.0", 8, "nynxz_1.0"),("revert21", "Exact revert 21β41", 4, "solve_mu0_L21-41"),("revert32", "Quality+ (revert 32β41)", 5, "qualityplus_lora"),("revert37", "DeBand (revert 37β41)", 6, "deband_lora")]6 unmodified linesdef edit(r, arm, centred=False):"""The arm's numbers for one linear, or None where it does not edit."""scaled = {"kijai_m05": ("kijai_m1", 0.5), "nynxz_1.5": ("nynxz", 1.5)} # LoRA strength s: energies x s^2, alignment x sif arm in scaled:src, f = scaled[arm]k = r.get(src)return k and {key: v * (f if key == "dot" else f * f) for key, v in k.items()}if centred and arm in CKPT:return r.get(CKPT[arm])if arm in RANGES:72 unmodified lines# chart 3: per-layer output-change size on solids vs general promptssel = {}for key in ("strong", "solve_rho1", "kijai_m1", "nynxz"):sel[key] = {"solid": [], "gen": []}for L in glayers:rs = [by[(L, p)] for p in PROJ]3 unmodified linessel[key]["solid"].append(ratio(sum(e[f] for e in es if e), sum(r["revert"][f] for r in rs)))sel[key]["gen"].append(ratio(sum(e[g] for e in es if e), sum(r["revert"][g] for r in rs)))# outcome benchmarks: rendered results (scores.jsonl) against weight-change share of the whole Base-SFT change (all 42 layers)total = sum(r["revert"]["w2"] for r in rows)def share(key, scale=1.0):if key == "base":return 1.0return scale * scale * sum(e["w2"] for r in rows for e in [edit(r, key)] if e) / totaldef outcome(arm):rs = [s for (a, _, _), s in scores.items() if a == arm]hf = [s["hf_db"] for s in rs if s.get("hf_db") is not None]af = [s["arcface"] for s in rs if s.get("arcface") is not None]dd = [s["dino_dist"] for s in rs if s.get("dino_dist") is not None]return {"clean": -statistics.median(hf), "clean_mean": -statistics.fmean(hf), "worst": -max(hf), "face": statistics.fmean(af),"dino": statistics.fmean(dd), "n": len(hf)}OUTCOMES = []for label, slot, arm, key, scale in [("nynxz Destripe @1.0", 8, "nynxz_1.0", "nynxz", 1.0), ("nynxz Destripe @1.5", 8, "nynxz_1.5", "nynxz", 1.5),("DeBand Strong @1.0", 7, "strong_full", "strong", 1.0), ("DeBand Strong @1.2", 7, "gcsolve_mu0.3_rho0.05_x1.2_L21-41", "strong", 1.2),("Gram solve Ο=0.1", 1, "solve_mu0_rho0.1_L21-41", "solve_rho0.1", 1.0), ("Gram solve Ο=1", 2, "solve_mu0_rho1_L21-41", "solve_rho1", 1.0),("Kijai LoRA @ β1", 3, "kijai_m1", "kijai_m1", 1.0), ("Kijai LoRA @ β0.5", 3, "kijai_m05", "kijai_m1", 0.5),("Exact revert 21β41", 4, "solve_mu0_L21-41", "revert21", 1.0), ("Quality+ (revert 32β41)", 5, "qualityplus_lora", "revert32", 1.0),("DeBand (revert 37β41)", 6, "deband_lora", "revert37", 1.0), ("Base model", 0, "base", "base", 1.0)]:o = outcome(arm)o.update(label=label, slot=slot, share=share(key, scale))OUTCOMES.append(o)data = {"arms": [[k, l, s] for k, l, s, _ in ARMS], "outcomes": OUTCOMES, "layers": layers, "size": size, "per_matrix": per_matrix,"sweep": sweep, "points": points, "plain": plain, "glayers": glayers, "sel": sel, "centred": centred}html = open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "anatomy_template.html")).read()open(os.path.join(OUT, "edit_anatomy.html"), "w").write(html.replace("__DATA__", json.dumps(data, ensure_ascii=False)))
research/build_anatomy.py+39-6