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
File size: 803 Bytes
1533f24 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | import sys
from pathlib import Path
import pytest
ROOT = Path(__file__).resolve().parent
sys.path.insert(0, str(ROOT))
from moss4gb.paths import default_model_dir # noqa: E402
# Resolved, not relative: a versioned snapshot shares the weights instead of
# duplicating them, and the suite should still find them there.
MODEL_DIR = default_model_dir()
@pytest.fixture(scope="session")
def model_dir() -> Path:
if not (MODEL_DIR / "transformer" / "config.json").is_file():
pytest.skip("model files not downloaded")
return MODEL_DIR
@pytest.fixture(scope="session")
def has_dit(model_dir) -> Path:
shards = sorted((model_dir / "transformer").glob("diffusion_pytorch_model-*.safetensors"))
if not shards:
pytest.skip("DiT weights not downloaded")
return model_dir
|