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/watchdog.sh from darask0/MOSS-Image_4-step_adapter_lora: direct link, hf CLI and curl.
- Browser
- Download file 712 Bytes
-
https://huggingface.co/darask0/MOSS-Image_4-step_adapter_lora/resolve/main/code/scripts/watchdog.sh
- Command line
-
hf download hf://darask0/MOSS-Image_4-step_adapter_lora/code/scripts/watchdog.sh
-
curl -L -o watchdog.sh https://huggingface.co/darask0/MOSS-Image_4-step_adapter_lora/resolve/main/code/scripts/watchdog.sh
712 Bytes
| # Local: stop the pod (keeps its volume) when the RunPod balance drops below $MIN (default 6). | |
| cd "$(dirname "$0")/.." | |
| source scripts/pod.env | |
| MIN=${MIN:-6} | |
| while true; do | |
| OUT=$(nix shell nixpkgs#python3 -c python3 scripts/runpod.py balance 2>/dev/null) || { sleep 120; continue; } | |
| BAL=$(echo "$OUT" | grep clientBalance | grep -o '[0-9.]*') | |
| RUN=$(echo "$OUT" | grep -c '"RUNNING"') | |
| echo "$(date +%T) balance=$BAL running=$RUN" | |
| [[ "$RUN" == 0 ]] && { echo "no running pod, exit"; exit 0; } | |
| if awk "BEGIN{exit !($BAL < $MIN)}"; then | |
| echo "balance below $MIN, stopping $POD_ID"; nix shell nixpkgs#python3 -c python3 scripts/runpod.py stop "$POD_ID"; exit 0 | |
| fi | |
| sleep 300 | |
| done | |