FableForge
Generate a picture book from a single prompt using OpenAI function calling, replicate, and Deep Lake
Install / Use
/learn @e-johnstonn/FableForgeREADME
📚 FableForge
📄 Description
Generate a picture book from a single prompt using OpenAI's new function calling and Replicate's API for Stable Diffusion. Store all your generated images and corresponding prompts in Deep Lake. Check example.pdf or watch the video below for a peek at the output.
Built with LangChain, Deep Lake, and Replicate.
:tv: Demo
https://github.com/e-johnstonn/FableForge/assets/30129211/f9523905-342e-4a33-914d-acd13bd168ec
🛠 Install
- Clone the repository
- Install requirements.txt
- Set up your OpenAI and Replicate API keys in
keys.env- More on this below - To save your images and prompts, set up your Activeloop Deep Lake token and dataset path in
keys.env- More on this below - Run
streamlit run main.pyto start the app!
🧠 Deep Lake Setup
During the creation of this project, I used Deep Lake to store the generated pictures and prompts in the cloud, as it makes it easy to work with multiple modalities of data (image/text), and displays them in a web UI. To set this up yourself, go to the Deep Lake website and make an account. Once logged in, you can click "Train deep learning models", then "Create dataset", which will guide you through getting an API token and dataset link. Put the token and dataset path in the keys.env file and you're good to go.
🖼️ Replicate Setup
A Replicate API key is necessary for this app. To get one, go to the Replicate website and create an account, then take your API key and put it in keys.env. Replicate provides free image generation for new users.
📐Architecture
Improvements
- This demo uses Replicate for image generation due to its ease of use. Connect it to your own Stable Diffusion setup (local or cloud-based) for better results. I recommend some combination of Diffusers and FastAPI as a starting point.
License
Related Skills
node-connect
338.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
338.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.6kCommit, push, and open a PR
