Dev.to AI ๐Ÿค– Ai ๐Ÿ‘ 0 ๐Ÿ“– 3 min read

The Dreadframe

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine What I Built The Dreadframe is a small horror story machine built for โ€œGhost in the Machine.โ€ Upload an ordinar

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine

What I Built

The Dreadframe is a small horror story machine built for โ€œGhost in the Machine.โ€ Upload an ordinary photograph and it returns two things: a horror-tinged transformation of the image, and a short story inspired by the contrast between the original and its dark reflection. You can save the images and story together as a PDF.

The idea is that the ghost doesnโ€™t have to appear as a literal figure. It can be the feeling that something familiar has changedโ€”that the same place, face, or object is holding a second, more unsettling story. The original stays beside the transformation, so the โ€œhauntingโ€ emerges from the difference between them.

Demo

Video demo: Present in the GitHub (https://github.com/aLok-1105/deadframe)

Code

GitHub repository: https://github.com/aLok-1105/deadframe

The project has a separate static frontend and a FastAPI backend. The backend handles image uploads, model requests, and PDF creation.

How I Built It

The Dreadframe uses two open-weight models as distinct parts of one experience:

  • Stable Diffusion v1.5 Inpainting (@cf/runwayml/stable-diffusion-v1-5-inpainting) transforms the uploaded image using image-to-image input, a full-image mask, and a horror-focused prompt.
  • Llama 3.2 11B Vision Instruct (@cf/meta/llama-3.2-11b-vision-instruct) receives a side-by-side comparison of the original and transformed images and writes the story.

A small FastAPI service connects those steps: validate the upload, request the image transformation, pass both images into story generation, and assemble the final PDF. The separate HTML, CSS, and JavaScript frontend presents the process and results.

A note on how it runs: the models are open-weight, but this version sends inference requests to Cloudflare Workers AI. It is not currently running models locally or operating offline, and uploaded images are sent to that provider for processing. I havenโ€™t trained or fine-tuned either model. The story model may also require accepting its license terms before first use.

Why Does Open Innovation Matter?

The open part of this project is what makes the experience composable. Instead of asking one opaque system to produce a finished result, I can use one model to transform an image and another to interpret the visual contrast and write a story. Their roles are visible in the code, and the model endpoints can be changed independently as the project evolves.

That flexibility matters for a project about a โ€œghost in the machineโ€: the uncanny effect comes from the collaboration between a personโ€™s photograph, an image model, and a language modelโ€”not from a fixed, hidden feature inside a single product. Open-weight models gave me the building blocks to shape that interaction around my own idea.

I chose hosted inference to make the prototype practical without managing GPU hardware. That is a tradeoff: this version depends on an internet connection and a provider, so it does not yet offer the privacy or offline benefits of local inference. But because the models and workflow are not tied to one closed, all-in-one generation feature, there is room to adapt the pipeline or explore local hosting later, subject to the modelsโ€™ licenses and hardware requirements. Open innovation made experimentation and that possibility of change part of the project from the start.

The Spirit of It

The Dreadframe starts with a photographโ€”something we usually treat as a record of what was there. Then it gives the image a second life and asks what might have been hiding just outside the original story.

Itโ€™s a playful Halloween-sized haunting, but thereโ€™s also something familiar in the idea: we return to old images and find new meaning in them as time passes. The machine supplies the shadow; the person looking at the image decides what the ghost means.

Prize Categories

๐Ÿ“ฐ Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes โ€” full credit and traffic to the original publisher.