Spaces:
Running
Running
|
Download README.md from notaneimu/onnx-web-upscale: direct link, hf CLI and curl.
- Browser
- Download file 2.92 kB
-
https://huggingface.co/spaces/notaneimu/onnx-web-upscale/resolve/main/README.md
- Command line
-
hf download hf://spaces/notaneimu/onnx-web-upscale/README.md
-
curl -L -o README.md https://huggingface.co/spaces/notaneimu/onnx-web-upscale/resolve/main/README.md
2.92 kB
metadata
title: ONNX Runtime Web Image Upscale in Browser
emoji: π
colorFrom: blue
colorTo: indigo
sdk: static
app_file: dist/index.html
pinned: false
ONNX Runtime Web Inspector
Static browser app for loading a local .onnx model and image, running inference with onnxruntime-web, and comparing the latest output to the previous run.
Files
index.htmlβ Vite entry HTML used for local dev and production builds.src/β Vue 3 app source (script setupcomponents, composables, and shared helpers).dist/β production build output generated by Vite. Hugging Face Static Spaces should servedist/index.html.package.jsonβ Bun scripts and frontend dependencies.vite.config.tsβ Vite config with Vue and Tailwind 4.tsconfig.jsonβ TypeScript config for the Vue app.convert_openmodeldb_to_onnx.pyβ Python script for exporting OpenModelDB-compatible.pth/.safetensorsimage models to ONNX.pyproject.tomlβ localuvproject metadata and pinned Python compatibility.uv.lockβ locked dependency resolution for reproducibleuv sync.requirements.txtβ exact local dependency snapshot foruv pip install -r.
Run the web app
Install frontend dependencies once:
bun install
Start the local Vite dev server:
bun run dev
Then open the local URL printed by Vite.
To verify the production bundle locally:
bun run build
bun run preview
Hugging Face Static Space
This repository is configured as a static Space and must serve the built Vite output, not the source index.html.
The YAML front matter at the top of this README.md includes:
app_build_command: bun install && bun run buildapp_file: dist/index.html
That makes Hugging Face:
- Install the Bun dependencies.
- Build the app into
dist/. - Serve
dist/index.html, which correctly references the hashed files indist/assets/.
If you change the frontend build output location, update app_file to match.
Convert a checkpoint to ONNX
Set up a local uv environment first:
uv python install 3.11.11
uv venv --python 3.11.11 --seed
source .venv/bin/activate
uv pip install -r requirements.txt
Or, if you prefer the locked project metadata route:
uv sync
Then run the converter from the local uv environment:
uv run python ./convert_openmodeldb_to_onnx.py /path/to/model.safetensors --output /path/to/model.onnx --seed 42
Useful flags:
--width/--heightcontrol the dummy trace size.--device cudaexports on GPU when needed.--static-shapedisables dynamic height/width axes.--no-checkskipsonnx.checker.
Notes
- The web app currently binds only the first model input and expects it to be a
float32image tensor. - The Python converter targets OpenModelDB-style image models supported by
spandrel/spandrel-extra-arches.