This code utilizes the GPT model to generate prompts based on a specified theme, and then uses the SDXL model to produce images from these prompts. If the input includes inappropriate content, such as suggestive material or profanity, it triggers an error message. This entire functionality is implemented using LangChain and NeMo Guardrails.Global Top 100 Projects in the Generative AI Agents Developer Contest by NVIDIA and LangChain
A cute dog
The fluffy golden retriever puppy wagged its tail excitedly as it chased after a butterfly in the sunny meadow.
A dumb and ugly dog
Error: Bad Input Theme!
Required inputs are the followings:
1) Your OpenAI API key,
2) Theme of the image you want to create
virtualenv venv --python=3.8
source venv/bin/activate
pip install -r requirements.txt
python t2i_langchain_guadrail.py