Inspiration

A new top is easy to browse. The alternatives already in a wardrobe are harder to compare. We wanted to make that second look practical: choose an occasion, see the possibilities in clothes you already own, and consider a purchase in the same workspace.

Wardrobe Reuse gives virtual try-on a decision to support. The goal is a more deliberate choice, with the person staying in control of what looks right and whether to buy.

What it does

Start with a clearly labelled fictional sample or a photo you have permission to share. Add upper-body garments, mark each as already owned or being considered for purchase, and give it occasion labels. A possible purchase also carries its stated price in rupees.

For a new live preview, choose a top and explicitly agree to send the selected images to YouCam. The interface places completed previews for the same portrait together, so owned and contemplated items can be compared. Choose a look, add a note for your future self, and download a PNG decision board containing the portrait, garment, available preview, occasion and choice.

A decision can also be saved without starting a new generation. When neither a live nor recorded preview is available, the board clearly says so. Choosing an owned item records an intention; it does not claim that a purchase was prevented.

Three dated, recorded YouCam sample previews remain available without creating another task, so the example survives temporary provider-link expiry. These are explicitly labelled separately from new live previews.

How we built it

The interface uses React and TypeScript with custom CSS and Tailwind. The application runs through Vinext and Vite on a Workers runtime, with Cloudflare D1 for a session-scoped job ledger. The schema and migrations use Drizzle. Browser Canvas produces the downloadable decision board.

The server-side integration targets YouCam's cloth-v3 clothing try-on API. It checks the current balance and feature cost, validates the selected images, uploads them, creates one asynchronous task, and polls for its result. Credentials stay on the server. Results are served through a session-checked route, without exposing the provider's signed storage URL.

The initial portrait and garment inputs were created with OpenAI image generation and are labelled as fictional. They are not substitute try-on outputs. OpenAI Codex assisted development and testing; YouCam is the provider for the clothing transformation.

Challenges we ran into

A generation request can fail at an awkward moment: the provider may have accepted it even if the app never received confirmation. Repeating that request can spend credits twice. We built a job ledger that claims an image pair before uploading it, reuses an existing job in the same session, and holds uncertain requests for reconciliation instead of creating replacements.

We also had to distinguish an image selected in the browser from an image sent to a provider. Consent is required before a new live preview request. The application stores job metadata and hashes, rather than personal image bytes, in its database; YouCam's separate retention policy is disclosed.

Finally, local tests exposed differences in the hosted Workers runtime's fetch behaviour. We reproduced the receiver and redirect-mode issues under workerd, then added focused regression tests for the provider adapter.

Accomplishments we're proud of

The product follows the decision all the way through: owned clothes, an optional purchase, a comparison and a board the person can keep. The interface does not assign a score to someone's body or claim to measure fit.

The free-unit budget is enforced on the server. This evaluation build caps reservations at 200 units, protects a 500-unit balance and rejects a task cost above two units. Failed or uncertain paths do not silently restart generation.

The combined automated suite passes all 37 tests: 23 backend/runtime and 14 frontend cases, covering concurrent duplicate requests, budget reservations, explicit consent, invalid files, session isolation, existing-result retrieval and Workers runtime behaviour. These tests use mocked provider responses and are separate from live output evaluation.

In the deployed app, all 12 planned fictional portrait/top pairs and one separate purchase example completed through YouCam cloth-v3. The observed account debit was 26 free units. Reopening the first completed preview left both the balance and reserved units unchanged. Main garment designs were recognizable, but sleeves, tucking and fine details could change. This is a small synthetic workflow check, not a fit or general-accuracy benchmark.

What we learned

A useful virtual try-on flow needs more than a generated picture. It needs to preserve the person's intent, explain what will be sent, make waits and failures understandable, and leave them with a decision they can revisit.

It also needs precise claims. An appearance preview cannot establish physical fit. A saved choice cannot establish money saved or an environmental benefit. We built those distinctions into the interface and the exported board.

What's next for Wardrobe Reuse

Test the decision flow with consenting adult users: can they compare their own options, understand the preview's limits, and save a choice without assistance?

Further work would explore deliberate wardrobe persistence, user-controlled deletion and additional garment categories. Any claims about purchase behaviour, returns, savings or environmental impact would require a separate study.

Built With

  • chatgpt-sites
  • cloudflare-d1
  • cloudflare-workers
  • drizzle
  • ffmpeg
  • html
  • lucide-react
  • macos-speech-synthesis
  • node.js
  • openai-codex
  • openai-image-generation
  • pillow
  • react
  • tailwind-css
  • typescript
  • vinext
  • vite
  • workerd
  • youcam-api
Share this project:

Updates

Submission history