axiomofmind/Moss-image-gouache-lora

Source: 🤗text-to-imageapache-2.0188 MBother✓ 23 checksumsupdated today
or submit a torrent

Moss Image Gouache LoRA

A colorful vintage-gouache illustration LoRA for MOSS-Image-SFT or MOSS-Image-Base, with MOSS-Image-SFT preferred for inference. It favors painterly shapes, warm editorial color, simplified forms, textured scenes, and bold illustrative compositions.

A GGUF conversion is also available here: https://huggingface.co/axiomofmind/Moss-image-gouache-lora-GGUF which can be used with MOSS-Image-SFT-GGUF

Recommended settings

  • Trigger: moss_vgouache_style
  • Preferred underlying model: OpenMOSS-Team/MOSS-Image-SFT
  • Also compatible with: OpenMOSS-Team/MOSS-Image-Base
  • LoRA scale: 1.0
  • Inference steps: 30
  • Guidance scale: 3.0
  • Resolution: 1024 x 1024
  • Negative prompt: empty

Place the trigger at the beginning of the prompt. Scale 1.0 was selected after local comparisons of checkpoints 1,000, 1,500, and 2,000 at scales 0.7, 1.0, and 1.2.

The adapter was trained against MOSS-Image-Base, which remains the training parent recorded in adapter_config.json. Its transformer targets are compatible with MOSS-Image-SFT, and SFT + LoRA produced the preferred evaluation results. All examples below use MOSS-Image-SFT plus this exact 1,500-step checkpoint at scale 1.0, image seed 42, 30 inference steps, guidance scale 3.0, and 1024 x 1024 resolution.

ComfyUI compatibility

The root pytorch_lora_weights.safetensors file uses Diffusers / PEFT key names and is intended for the Diffusers workflow. ComfyUI's native MOSS-Image model uses a different internal key namespace, so loading that file directly can produce lora key not loaded warnings.

For native ComfyUI, download MOSS-Image-Gouache-LoRA-ComfyUI.safetensors. It contains the same 504 LoRA tensors and weights as the root adapter, with only the key prefix changed from transformer.layers... to diffusion_model.layers....

File Size Tensors SHA-256
MOSS-Image-Gouache-LoRA-ComfyUI.safetensors 70.93 MiB 504 136736fd02a932068982a2211f3010ca579d0186a784b37af592020eb947cedf
  1. Update ComfyUI to commit b1a247c or newer, which includes native MOSS-Image support.
  2. Put the ComfyUI file in ComfyUI/models/loras/.
  3. Load it with the standard LoRA loader using model strength 1.0 and CLIP strength 0.0.
  4. Begin the prompt with moss_vgouache_style.
hf download axiomofmind/Moss-image-gouache-lora \
  MOSS-Image-Gouache-LoRA-ComfyUI.safetensors \
  --local-dir ./ComfyUI/models/loras

The rekeying is namespace-only: tensor shapes, dtypes, and values are unchanged. The included scripts/convert_moss_lora_for_comfyui.py script documents and reproduces the conversion. The separate GGUF adapter linked above is for stable-diffusion.cpp, not ComfyUI's native LoRA loader.

Examples

Café scene

River canyon

Indoor putting

Floral portrait

Summer table

Pink fox feast

Farmhouse landscape

Base, SFT, and LoRA comparison

The table compares three generation conditions using the same descriptive prompt, image seed 42, 1024 x 1024 resolution, 30 inference steps, and guidance scale 3.0:

  • MOSS-Image-Base + LoRA: the original training parent with this adapter at scale 1.0 and moss_vgouache_style in the prompt.
  • Stock MOSS-Image-SFT: SFT without the LoRA and with only the trigger phrase removed.
  • MOSS-Image-SFT + LoRA: the preferred inference configuration, with this adapter at scale 1.0 and the trigger included.
Sample MOSS-Image-Base + LoRA Stock MOSS-Image-SFT MOSS-Image-SFT + LoRA (preferred)
0 — Café scene
1 — River canyon
2 — Indoor putting
3 — Floral portrait
4 — Summer table
5 — Pink fox feast
6 — Farmhouse landscape

Use with Diffusers and PEFT

MOSS-Image uses a custom Diffusers pipeline. Attach the adapter to its transformer with PEFT:

import json

import torch
from diffusers import DiffusionPipeline
from huggingface_hub import hf_hub_download
from peft import LoraConfig, inject_adapter_in_model, set_peft_model_state_dict
from peft.tuners.lora.layer import LoraLayer
from safetensors.torch import load_file

repo_id = "axiomofmind/Moss-image-gouache-lora"
base_model = "OpenMOSS-Team/MOSS-Image-SFT"  # Preferred; Base is also supported.
lora_scale = 1.0

config_path = hf_hub_download(repo_id, "adapter_config.json")
weights_path = hf_hub_download(repo_id, "pytorch_lora_weights.safetensors")

with open(config_path, encoding="utf-8") as file:
    config = json.load(file)

pipe = DiffusionPipeline.from_pretrained(
    base_model,
    custom_pipeline="pipeline_moss_image",
    trust_remote_code=True,
    torch_dtype={"default": torch.bfloat16, "vae": torch.float32},
)
pipe.scheduler = type(pipe.scheduler).from_config(pipe.scheduler.config)

inject_adapter_in_model(
    LoraConfig(
        r=config["r"],
        lora_alpha=config["lora_alpha"],
        target_modules=config["target_modules"],
    ),
    pipe.transformer,
)

state = {
    key.removeprefix("transformer."): value
    for key, value in load_file(weights_path, device="cpu").items()
}
_, unexpected = set_peft_model_state_dict(pipe.transformer, state)
if unexpected:
    raise RuntimeError(f"Unexpected LoRA tensors: {unexpected[:5]}")

for layer in pipe.transformer.modules():
    if isinstance(layer, LoraLayer):
        layer.set_scale("default", lora_scale)

pipe.transformer.to(torch.bfloat16)
pipe.to("cuda")

prompt = (
    "moss_vgouache_style, a white farmhouse with a red roof sits on a golden "
    "hillside surrounded by pink and orange trees beneath a soft pink sky."
)

image = pipe(
    prompt,
    negative_prompt="",
    width=1024,
    height=1024,
    num_inference_steps=30,
    guidance_scale=3.0,
    uncond_skip_layers=[22],
    generator=torch.Generator("cpu").manual_seed(42),
).images[0]

image.save("moss_gouache.png")

Training details

  • Training base model: OpenMOSS-Team/MOSS-Image-Base
  • Preferred inference model: OpenMOSS-Team/MOSS-Image-SFT
  • Selected checkpoint: 1,500 steps from a 2,000-step training run
  • Training images: 70
  • Resolution: 1024
  • LoRA rank / alpha: 16 / 16
  • Target modules: transformer attention projections and feed-forward projections
  • Optimizer: AdamW
  • Learning rate: 1e-4
  • Scheduler: constant with warmup
  • Batch size / gradient accumulation: 1 / 1
  • Weight decay: 0.01
  • Training seed: 42
  • Caption dropout: 0
  • Random horizontal flip: disabled
  • Training environment: local hardware

Intended use and limitations

This adapter is intended for creative image generation and illustration experiments. It is strongest with editorial scenes, landscapes, portraits, interiors, food still lifes, warm color palettes, and simplified painterly forms. Very high LoRA scales can over-stylize fine details or reduce prompt fidelity.

License

The adapter files are provided under the Apache License 2.0, matching the base model. This is an independent community LoRA and is not an official OpenMOSS release. The license does not grant rights to third-party source material, trademarks, or depicted persons.