Instructions to use KBlueLeaf/MOSS-Image-heal with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use KBlueLeaf/MOSS-Image-heal with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("KBlueLeaf/MOSS-Image-heal", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- Draw Things
- DiffusionBee
Link the KohakuMoss concept docs
Browse files23 unmodified lines24252627282924 unmodified lines54555657585912 unmodified lines727374757677785 unmodified lines8485868788899062 unmodified lines15315415515615715815916023 unmodified linesThe transformer is the trained part. Text encoder, tokenizer, VAE, scheduler and pipelinecode are the official MOSS-Image-Base ones.| file | for || --- | --- || `transformer/` | diffusers `MOSSImageTransformer` (official config, bf16) |24 unmodified lines## Residual streamMeasured on 6 text-image samples at 1024^2 area, sigma 0.3 / 0.5 / 0.7 / 0.9 / 0.5 /0.7 with fixed noise, bf16 forward, fp32 statistics; each value is the mean over the 6rows of the per-block statistic.12 unmodified lines| velocity cosine to base | 1 | 0.9983 |What each block writes into the stream (the attention + FFN sublayer outputs after theirgates):5 unmodified lines## WeightsElements above a multiple of their tensor's RMS, over every 2-D tensor of the transformer(185 tensors, about 5.08 billion elements):| above | base | heal || --- | --- | --- |62 unmodified lines(`gbc.soft` in the samples above), each with artist, copyright, character, quality, eraand rating sections and random section and tag dropout.The losses and the decay are KohakuMoss's `STREAM_LOSS` and `OUTLIER_DECAY`([stream healing](https://github.com/KohakuBlueleaf/KohakuMossTrainer/blob/main/docs/concepts/stream-healing.md)).## Usage23 unmodified lines242526272829303132333435363738394024 unmodified lines656667686970717212 unmodified lines8586878889909192935 unmodified lines9910010110210310410510610762 unmodified lines17017117217317417517617717817918023 unmodified linesThe transformer is the trained part. Text encoder, tokenizer, VAE, scheduler and pipelinecode are the official MOSS-Image-Base ones.The concepts behind this model are written up in KohakuMoss:- [Massive residual channels in MOSS-Image](https://github.com/KohakuBlueleaf/KohakuMossTrainer/blob/main/docs/concepts/massive-channels.md):the few huge channels of the base model's residual stream, what they do, and how a healshrinks them.- [Healing the stream and the weights during a finetune](https://github.com/KohakuBlueleaf/KohakuMossTrainer/blob/main/docs/concepts/stream-healing.md):the stream losses (write concentration, RMS) and the outlier decay of the weights usedin this run, with a toy model and their combination.- [Numerics](https://github.com/KohakuBlueleaf/KohakuMossTrainer/blob/main/docs/concepts/numerics.md):the fp16 residual-stream fold the training ran with.| file | for || --- | --- || `transformer/` | diffusers `MOSSImageTransformer` (official config, bf16) |24 unmodified lines## Residual streamThe stream statistics below follow[massive-channels.md](https://github.com/KohakuBlueleaf/KohakuMossTrainer/blob/main/docs/concepts/massive-channels.md).Measured on 6 text-image samples at 1024^2 area, sigma 0.3 / 0.5 / 0.7 / 0.9 / 0.5 /0.7 with fixed noise, bf16 forward, fp32 statistics; each value is the mean over the 6rows of the per-block statistic.12 unmodified lines| velocity cosine to base | 1 | 0.9983 |What each block writes into the stream (the attention + FFN sublayer outputs after theirgates); the write-concentration loss([stream-healing.md section 4](https://github.com/KohakuBlueleaf/KohakuMossTrainer/blob/main/docs/concepts/stream-healing.md#4-the-write-term))acts on these writes:5 unmodified lines## WeightsElements above a multiple of their tensor's RMS, over every 2-D tensor of the transformer(185 tensors, about 5.08 billion elements). The outlier decay([stream-healing.md section 5](https://github.com/KohakuBlueleaf/KohakuMossTrainer/blob/main/docs/concepts/stream-healing.md#5-outlier-decay))pulls each weight's excess over a capped multiple of its start RMS:| above | base | heal || --- | --- | --- |62 unmodified lines(`gbc.soft` in the samples above), each with artist, copyright, character, quality, eraand rating sections and random section and tag dropout.The losses and the decay are KohakuMoss's `STREAM_LOSS` and `OUTLIER_DECAY`: the writeterm in [stream-healing.md section 4](https://github.com/KohakuBlueleaf/KohakuMossTrainer/blob/main/docs/concepts/stream-healing.md#4-the-write-term),the outlier decay in [section 5](https://github.com/KohakuBlueleaf/KohakuMossTrainer/blob/main/docs/concepts/stream-healing.md#5-outlier-decay),the combination used here in [section 6](https://github.com/KohakuBlueleaf/KohakuMossTrainer/blob/main/docs/concepts/stream-healing.md#6-the-combination),and the fp16 fold in [numerics.md](https://github.com/KohakuBlueleaf/KohakuMossTrainer/blob/main/docs/concepts/numerics.md#the-fold).## Usage
README.md+24-4