Instructions to use AEUPH/moss4gb with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use AEUPH/moss4gb with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("AEUPH/moss4gb", 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
Download tests/test_cli.py from AEUPH/moss4gb: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/AEUPH/moss4gb/resolve/main/tests/test_cli.py
- Command line
-
hf download hf://AEUPH/moss4gb/tests/test_cli.py
-
curl -L -o test_cli.py https://huggingface.co/AEUPH/moss4gb/resolve/main/tests/test_cli.py
1.23 kB
| from __future__ import annotations | |
| import pytest | |
| from moss4gb.cli import _parse_skip, build_parser | |
| def test_parse_skip(): | |
| assert _parse_skip("22") == (22,) | |
| assert _parse_skip("22,24,26") == (22, 24, 26) | |
| assert _parse_skip("") == () | |
| assert _parse_skip("none") == () | |
| assert _parse_skip("off") == () | |
| def test_generate_defaults(): | |
| args = build_parser().parse_args(["generate"]) | |
| assert (args.height, args.width) == (512, 512) | |
| assert args.steps == 20 | |
| assert args.cfg == 3.0 | |
| assert args.compute_dtype == "float16" | |
| assert args.vae_device == "cpu" | |
| from pathlib import Path | |
| assert Path(args.bank) == Path("assets/bank") | |
| def test_bank_build_requires_a_prompt(): | |
| args = build_parser().parse_args(["bank", "build", "--dry-run", "--prompt", "x"]) | |
| assert args.bank_action == "build" and args.dry_run and args.prompt == ["x"] | |
| def test_subcommand_is_required(): | |
| with pytest.raises(SystemExit): | |
| build_parser().parse_args([]) | |
| def test_generate_cache_flags(): | |
| args = build_parser().parse_args(["generate"]) | |
| assert args.cache is None and args.no_cache is False | |
| args = build_parser().parse_args(["generate", "--no-cache"]) | |
| assert args.no_cache is True | |