This is a submission for the Hacktoberfest Open-Source AI Challenge Week 3: Slow and Steady
What I Built
We’ve all been there: you wake up from a vivid, wild dream, scribble down a few hazy keywords like "floating clock, neon fog, library with no doors", and by the time you pour your morning coffee, the rest of the memory has completely evaporated.
Nightloom turns those fading scraps into something lasting.
You type in your raw, half-remembered fragments—in any order, with zero formatting—and Nightloom weaves them into a structured short story and paints a watercolor scene from it.
Everything runs 100% locally on your computer, so your beloved dreams stay with you. Because memory efficiency was a core design constraint, it works seamlessly even on modest machines with just 4–6 GB of free RAM.
To match the "Slow and Steady" theme, the page itself embraces a soothing night-sky aesthetic complete with drifting lanterns, an arched golden loom, and thread-weaving animations.
Demo
Code
marinn-3011
/
nightloom-dream-logger
NightLoom: A Dream-Logging application that visualizes your dreams from fragments (HF26)
Nightloom
A local-first dream logger. Type scattered fragments of a dream, in any order, and Gemma weaves them into one dreamlike story. Optionally, a small open image model paints one scene from it in a watercolor style.
Everything runs on your machine. The page talks to a small Python server on 127.0.0.1, which talks to Ollama on localhost and, for images, to a local stable-diffusion.cpp program. Dreams are saved to dreams.jsonl in this folder.
Run it (text only)
- Install Ollama. Gemma 4 needs a recent version (0.22 or newer).
- Pull a model:
ollama pull gemma4. On a low-memory laptop, try a smaller tag such asgemma4:e2band start the app withDREAM_MODEL=gemma4:e2b python3 dream.py. - Start the app:
python3 dream.py - Open http://127.0.0.1:8765
No pip install needed. The page shows a status line, so you'll see if Ollama or the model is missing.
Add images (optional)
Images use…
How I Built It
Nightloom is powered entirely by open-source components, orchestrated by a single zero-dependency Python server (dream.py) and a lightweight single-file frontend (index.html).
Story Generation: Gemma 4 (running locally via Ollama, using the light gemma4:e2b tag). The prompt strictly guides Gemma to retain every user fragment, avoid interpreting psychological meanings, and leave ambiguous parts blurry rather than inventing major plot points. Still, the model may get creative in ways to tie up the fragments into a cohesive story.
Image Generation Engine: stable-diffusion.cpp, a lightweight C/C++ runner that runs Stable Diffusion on laptop CPUs without heavy framework overhead.
Speed & Style: A standard Stable Diffusion 1.5 checkpoint enhanced with LCM-LoRA (latent-consistency/lcm-lora-sdv1-5) to reduce render times to ~4 steps, and fladdict's watercolor LoRA (trained on public-domain historical paintings) to give every painting a cohesive art style.
The Low-RAM Swap Trick: To run smoothly on devices with only 4–6 GB of free RAM, dream.py automatically unloads Gemma from RAM before running stable-diffusion.cpp, freeing up system resources for image rendering.
Honest Limitations
CPU Render Speeds: CPU painting takes a few moments on standard laptop processors.
SD 1.5 Detail: As a lightweight model, facial details and fine elements can be painterly and rough.
Minor Filler: While the prompt strictly restricts inventing new plotlines, the LLM will occasionally add brief connective phrasing to link fragments together.
Why Does Open Innovation Matter?
Absolute Privacy for Private Thoughts: Dreams are about as personal as text gets. Sending your half-conscious thoughts to a hosted cloud API feels invasive. Local inference guarantees your dreams stay on your device.
Zero Cost & No Rate Limits: You can weave and paint as many dreams as you want without worrying about API keys, usage limits, or monthly tokens.
Community Composability: Nightloom exists because independent creators shared their work—from stable-diffusion.cpp's lightweight engine to fladdict's public-domain watercolor LoRA. Closed models simply don't allow this level of modular stitching.
The Lazy Payoff
Dream journaling usually takes active effort right when you're least awake. Nightloom turns lazy inputs into a full creative artifact. You type three messy fragments while still half-asleep, hit one button, and get a rendered story and framed watercolor painting back. So the next time your divine muse brings you that flash of inspo, sleep in, and leave the heavy-lifting to Nightloom.
Prize Categories
Best Use of Gemma
Top comments (0)