Instructions to use chenzeyang1/T with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use chenzeyang1/T with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("chenzeyang1/T", torch_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
| """ | |
| Default paths for TherA inference (relative to this repository root). | |
| Download model weights into the `weights/` directory — see README.md. | |
| """ | |
| from __future__ import annotations | |
| import sys | |
| from pathlib import Path | |
| PROJECT_ROOT = Path(__file__).resolve().parent | |
| WEIGHTS_DIR = PROJECT_ROOT / "weights" | |
| DEFAULT_CHECKPOINT = WEIGHTS_DIR / "checkpoint" | |
| DEFAULT_MERGED_MODEL = WEIGHTS_DIR / "merged_models" | |
| DEFAULT_PRETRAINED_SD = WEIGHTS_DIR / "stable-diffusion" | |
| DEFAULT_REFERENCE_CACHES = WEIGHTS_DIR / "reference_caches" | |
| def setup_project_path() -> Path: | |
| """Ensure TherA root is on sys.path so local packages import correctly.""" | |
| root = str(PROJECT_ROOT) | |
| if root not in sys.path: | |
| sys.path.insert(0, root) | |
| return PROJECT_ROOT | |