Instructions to use Autodraft/CM2000112 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use Autodraft/CM2000112 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("Autodraft/CM2000112", 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: 658 Bytes
b71808f 35575bb b71808f 19b3da3 fd5252e 19b3da3 1bc457e b71808f 19b3da3 | 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 | import os
import sys
path = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(1, os.path.join(path, "external"))
from pathlib import Path
from typing import Any, Dict, List
from inference import model_fn, predict_fn
from internals.util.config import set_hf_cache_dir, set_model_config
from internals.util.model_loader import load_model_from_config
class EndpointHandler:
def __init__(self, path=""):
set_hf_cache_dir(Path.home() / ".cache" / "hf_cache")
self.model_dir = path
return model_fn(self.model_dir)
def __call__(self, data: Any) -> List[List[Dict[str, float]]]:
return predict_fn(data, None)
|