xray-anything / README.md
ysharma's picture
ysharma HF Staff
docs: add demo video link (#1)
400dc53
|
Raw
History Blame Contribute Delete
2.84 kB
---
title: X-Ray Anything
emoji: 🩻
colorFrom: indigo
colorTo: blue
sdk: gradio
sdk_version: 6.17.3
app_file: app.py
pinned: false
license: other
short_description: Photograph any object β€” watch it ride into a 3D scanner
tags:
- track:wood
- achievement:offbrand
- achievement:offgrid
models:
- black-forest-labs/FLUX.2-klein-9B
- Qwen/Qwen2.5-VL-3B-Instruct
---
# 🩻 X-Ray Anything
**Photograph any object. Watch it ride the patient table into a 3D MRI
machine. It comes back out as a radiograph of its insides.**
Drop in a photo of your keyboard, your coffee machine, your graphics card β€”
the scanner produces an X-ray view of *your actual object*: translucent
shell, glowing internals, silhouette preserved.
## How the scan works
1. **Qwen2.5-VL-3B** looks at your photo, identifies the object, and lists
the internal components it should contain
2. **FLUX.2-klein-9B** *edits your photo* β€” same silhouette, same position β€”
into an X-ray radiograph revealing those internals (4-step rectified
flow, sub-second on the GPU)
3. The whole experience plays out in a **3D scanner built with Three.js**:
your photo slides into the bore on the patient table, scan beams sweep,
the machine hums, and the radiograph slides back out
Everything fits the small-model constraint: 9B + 3B, both far under 32B.
## Built on `gr.Server`
No default Gradio UI anywhere β€” the frontend is a single hand-written page
(Three.js scene, WebAudio scanner hum, boot sequence) served by **Gradio 6's
`gr.Server`**, with the model behind a `@app.api` endpoint and called via
`@gradio/client`. Queueing and concurrency still come from Gradio under the
hood.
```
frontend/index.html the 3D radiology console (no build step, CDN ESM)
app.py gr.Server: /xray endpoint + static routes
```
Run the UI locally without a GPU: `XRAY_MOCK=1 python app.py` replays a
cached scan so the full animation is testable on a laptop.
> 🎨 Radiographs are an AI's imagination of the inside, made for wonder β€”
> not engineering documentation.
*Build Small Hackathon 2026 Β· Thousand Token Wood track Β·
[Barath](https://huggingface.co/Barath)*
## Submission
- **Demo video:** https://youtu.be/kVkX3Dg5gOg
- **Social post:** https://x.com/barathishere/status/2066882090054930704
### Badges claimed
| Badge | Why X-Ray Anything qualifies |
|---|---|
| 🌲 **Thousand Token Wood** (`track:wood`) | A whimsical, joyful toy: photograph anything, watch it ride into a 3D scanner and come back as a radiograph. |
| 🎨 **Off Brand** (`achievement:offbrand`) | No default Gradio UI β€” a hand-written Three.js radiology console (3D scanner, WebAudio hum, boot sequence) served via `gr.Server`. |
| πŸ”Œ **Off the Grid** (`achievement:offgrid`) | Both models run in-Space on ZeroGPU; no external AI API is called. |