cosmic-ai / app.py
taarhissian's picture
Create app.py
2c381f6 verified
# Define a function to integrate text and image generation
def cosmic_ai(prompt):
"""
This function combines the meditative text and image generation.
It takes a text prompt as input and returns both the text output
and the generated image.
"""
# Generate text using T5
text_output = generate_meditative_text(prompt)
# Generate image using Stable Diffusion
image_output = generate_cosmic_image(prompt)
return text_output, image_output
# Create a Gradio interface
interface = gr.Interface(
fn=cosmic_ai, # Function to call for generating text and image
inputs="text", # Input type: single text prompt
outputs=["text", "image"], # Output types: text and image
title="Cosmic Resonance AI", # Title of the app
description=(
"Enter a cosmic or meditative theme (e.g., 'Golden Ratio harmony' or 'Quantum fractals'). "
"The AI will generate a meditative text response and a cosmic visual."
)
)
# Launch the interface
interface.launch()