# Bernini renderer, pinned to a commit for reproducibility. Its pyproject pins # diffusers==0.35.2 / transformers==4.57.3 / accelerate==0.34.2 and only # torch>=2.4.0, so installing it does NOT clobber the torch that the ZeroGPU # base image provides (>=2.8, required for the AOTI path). git+https://github.com/bytedance/Bernini.git@94a52f78b6376ddeea6d6744c25565341c12d37d # Needed at import / runtime but NOT declared by bernini's pyproject: sentencepiece # UMT5 text-encoder tokenizer (tokenizer/spiece.model) # torchao is INTENTIONALLY NOT installed (was: FP8 dynamic quant). Two blockers # on the current ZeroGPU base image (torch 2.11.0+cu130): # 1. torchao's compiled FP8 kernels are incompatible with torch 2.11 (it logs # "Skipping import of cpp extensions ... incompatible torch version", see # github.com/pytorch/ao/issues/2919) -- so FP8 wouldn't actually accelerate. # 2. Merely having torchao installed makes diffusers==0.35.2 (pulled in by # bernini) probe torchao at import. Its probe imports module paths that newer # torchao removed (floatx.float8_layout / uintx.uint4_layout), and the # diffusers fallback handler is itself buggy (undefined `logger`), turning a # soft warning into a hard import crash that kills the whole app. # With torchao absent, diffusers skips the probe (is_torchao_available()==False) # and the app runs the bf16 path. Set BERNINI_FP8=0 (Space variable) to match. # Revisit FP8 once torch<=2.x / torchao alignment on the base image is sorted. # torch comes from the ZeroGPU base image (currently 2.11.0+cu130) — do NOT pin # it. torchvision is NOT in the base image, but bernini imports it # (`from torchvision import transforms` in data_utils.py), so we add it. Pin to # the version that matches torch 2.11.0 and pull the cu130 build from the pytorch # index so it does not drag a CPU torch: torchvision 0.26.0 requires torch==2.11.0, # already satisfied by the base, so torch is not reinstalled. --extra-index-url https://download.pytorch.org/whl/cu130 torchvision==0.26.0 # decord, imageio-ffmpeg, einops, ftfy, safetensors, Pillow, numpy arrive via bernini. # # `spaces` and `gradio` are managed by the platform (gradio via sdk_version in # README.md frontmatter); do not list them.