DEV Community

Pavani Verma
Pavani Verma

Posted on

πŸ‘» Ghost Story Generator: Bringing AI-Powered Horror Stories to Life

Hacktoberfest Open-Source AI Challenge: Ghost in the Machine Submission πŸ‘»πŸŒΌ

πŸ‘» Ghost Story Generator β€” An AI-Powered Spooky Story Creator

Ever wondered what happens when AI enters the world of ghosts, mysteries, and spooky stories? πŸ‘€

For the DEV Week 4 Challenge, I built Ghost Story Generator, a simple web app that creates spooky stories using AI!

πŸ’‘ What is this project?

Ghost Story Generator is a web application where users can enter a story idea, choose a mood, select a story length, and optionally provide a setting. The AI then attempts to generate a unique story based on those inputs.

Whether it's an abandoned college, a mysterious forest, or strange footsteps at midnight, your imagination provides the starting point! πŸŒ™

✨ Features

  • πŸ‘» Generate stories from your own ideas.
  • πŸŒ™ Choose a mood: Spooky, Mysterious, Funny, or Folklore-inspired.
  • πŸ“– Select the approximate story length.
  • 🏚️ Add a custom setting for your story.
  • πŸ“₯ Download the generated story as a text file.

πŸ› οΈ Tech Stack

  • Python β€” Application logic
  • Streamlit β€” Web application interface
  • Hugging Face Transformers β€” AI text generation
  • FLAN-T5 Small β€” Language model used for story generation

πŸš€ How It Works

  1. Enter a story idea.
  2. Select your preferred mood and story length.
  3. Add a setting if you want.
  4. Click the generate button.
  5. Read your AI-generated story and download it.

The model may need to download the first time the app runs, so an internet connection is recommended during initial setup.

πŸ’» GitHub Repository

πŸ”— Project Source Code:
https://github.com/pavaniverma18-blip/ghost-story-generator

πŸ“š What I Learned

Building this project helped me explore Streamlit, experiment with AI text-generation models, and understand how to connect a machine learning model to a simple web interface.

I also learned that getting an AI application to run reliably requires testing, debugging, and handling errorsβ€”not just writing code!

πŸ‘€ What's Next?

I'd love to improve the project with more creative story styles, better story quality, and additional customization options.

If you could generate a horror story about anything, what would your idea be? Share it in the comments! πŸ‘‡

#devchallengesvg #hf26challengesvg

Top comments (0)