lab-vyfdxey4 / config.py
Gertie01's picture
Deploy Gradio app with multiple files
cb390da verified
raw
history blame contribute delete
553 Bytes
import os
import torch
# Diffusion Model IDs
MODEL_ID_BASE = "stabilityai/stable-diffusion-xl-base-1.0"
MODEL_ID_CANNY = "diffusers/controlnet-sdxl-1.0-canny"
MODEL_ID_DEPTH = "diffusers/controlnet-sdxl-1.0-depth"
# Hardware Configuration
DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
# Use bfloat16 for supported GPUs (e.g., A100, H100, H200) for performance, else float32
DTYPE = torch.bfloat16 if torch.cuda.is_available() and torch.cuda.is_bf16_supported() else torch.float32
print(f"Initialized config: Device={DEVICE}, DType={DTYPE}")