Instructions to use darask0/MOSS-Image_4-step_adapter_lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use darask0/MOSS-Image_4-step_adapter_lora with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("OpenMOSS-Team/MOSS-Image-SFT", dtype=torch.bfloat16, device_map="cuda") pipe.load_lora_weights("darask0/MOSS-Image_4-step_adapter_lora") 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
Download code/scripts/main_run.sh from darask0/MOSS-Image_4-step_adapter_lora: direct link, hf CLI and curl.
- Browser
- Download file 1.15 kB
-
https://huggingface.co/darask0/MOSS-Image_4-step_adapter_lora/resolve/main/code/scripts/main_run.sh
- Command line
-
hf download hf://darask0/MOSS-Image_4-step_adapter_lora/code/scripts/main_run.sh
-
curl -L -o main_run.sh https://huggingface.co/darask0/MOSS-Image_4-step_adapter_lora/resolve/main/code/scripts/main_run.sh
1.15 kB
| # Runs on the main pod (all GPUs): setup -> text cache -> [teacher samples] -> training. | |
| # DISC_REAL=adm|teacher TEACHER_COUNT=2400 bash scripts/main_run.sh [--set key=value ...] | |
| # Expects code at /workspace/code and prompts at /workspace/prompts/{train,eval}.jsonl. | |
| set -euo pipefail | |
| cd /workspace/code | |
| N=$(nvidia-smi -L | wc -l) | |
| M=/workspace/models/MOSS-Image-SFT | |
| echo "== setup $(date -u +%T)" | |
| bash scripts/pod_setup.sh | |
| echo "== text cache $(date -u +%T)" | |
| torchrun --nproc-per-node "$N" -m rapid_moss.textenc --model $M \ | |
| --prompts /workspace/prompts/train.jsonl /workspace/prompts/eval.jsonl --out /workspace/cache | |
| EXTRA=(disc_real=adm) | |
| if [[ "${DISC_REAL:-teacher}" == teacher ]]; then | |
| echo "== teacher samples $(date -u +%T)" | |
| torchrun --nproc-per-node "$N" -m rapid_moss.teachergen --model $M --cache /workspace/cache \ | |
| --prompts /workspace/prompts/train.jsonl --out /workspace/teacher --count "${TEACHER_COUNT:-2000}" | |
| EXTRA=() | |
| fi | |
| echo "== train $(date -u +%T)" | |
| torchrun --nproc-per-node "$N" -m rapid_moss.train --config configs/main.json --set "${EXTRA[@]}" "$@" | |
| echo "== done $(date -u +%T)" | |