Skip to content

colour8k/ImageGen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

TheKerrProject

Description

TheKerrProject is a web application designed to generate images from user-provided text prompts. It leverages the power of Google AI Platform (specifically, a model like Imagen) for image creation and enhances the user experience by generating witty comments related to the image prompt using the Google Gemini API.

Features

  • Prompt-based Image Generation: Create unique images by simply typing a descriptive text prompt.
  • Witty Comment Integration: Get an amusing, AI-generated comment related to your image idea before the image is generated.
  • Interactive User Interface: Experience a smooth workflow with clear status updates (e.g., "Generating...", "Error messages").
  • Downloadable Images: Easily save your generated masterpieces to your local device.

Getting Started / How to Run

  1. Open the Application: To run the application, simply open the image_gen_app/index.html file in a modern web browser (e.g., Chrome, Firefox, Safari, Edge).
  2. Generate an Image:
    • Locate the input field on the page.
    • Enter a text prompt describing the image you wish to create (e.g., "a cat wearing a wizard hat riding a unicorn on a rainbow").
    • Press the Enter key.
    • The application will first generate a witty comment, then proceed to generate your image.

Dependencies

This project relies on the following client-side JavaScript libraries, which are included in the image_gen_app/libs/ directory:

Known Issues

  • Security Vulnerability (Hardcoded API Keys):
    • Currently, API keys for Google AI Platform and Google Gemini, as well as a bearer token, are hardcoded directly into the client-side JavaScript file (image_gen_app/index.html lines 257-260, 264, and 454).
    • This is a significant security risk. Exposing API keys and tokens in client-side code allows unauthorized users to potentially misuse them, leading to unexpected charges or service abuse.
    • Recommendation: For any non-trivial or public deployment, these keys MUST be moved to a secure backend service. The client application should then make requests to this backend, which would, in turn, call the Google APIs.

Future Enhancements

  • Secure API Key Management: Implement a backend service (e.g., using Node.js, Python/Flask, etc.) to securely store and use API keys.
  • Model Selection & Parameters: Allow users to choose from different image generation models or adjust parameters like image size, style, or quality.
  • Image History: Store and display a gallery or list of previously generated images for the user.
  • Improved Error Handling: Provide more specific and user-friendly error messages for various failure scenarios (API errors, network issues, etc.).
  • User Authentication: Introduce user accounts to save preferences, image history, or manage API usage.
  • Advanced Prompting Features: Explore options like negative prompts, image-to-image generation, or prompt weighting.

Technical Overview (Simplified)

  • Frontend: Built with standard web technologies: HTML, CSS, and modern JavaScript (utilizing ES Modules).
  • External APIs:
    • Google AI Platform (likely an Imagen model via the endpoint specified in image_gen_app/index.html) for the core image generation.
    • Google Gemini API (model gemini-1.5-flash-latest via endpoint in image_gen_app/index.html) for generating witty comments.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors