Skip to content

Suhaanthsuhi/TextToImage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Image Generation with Stable Diffusion and GPT-3

Overview

This project demonstrates the generation of images based on textual prompts using Stable Diffusion and GPT-3. Stable Diffusion is a technique for generating high-quality images by iteratively refining a noise tensor. GPT-3, on the other hand, is a state-of-the-art language model capable of understanding and generating human-like text.

Libraries Used

  • pathlib: A library for handling file paths.
  • tqdm: A library for displaying progress bars during iterative processes.
  • torch: PyTorch, a deep learning framework.
  • pandas: A data manipulation library.
  • numpy: A library for numerical computing.
  • diffusers: A library for Stable Diffusion image generation.
  • transformers: A library for natural language processing tasks, including interaction with GPT-3.
  • matplotlib.pyplot: A library for creating visualizations.
  • cv2: OpenCV, a library for computer vision tasks.

Configuration (CFG)

  • device: Specifies the device to run computations on (e.g., "cuda" for GPU).
  • seed: Seed value for random number generation.
  • generator: PyTorch generator initialized with the specified seed.
  • image_gen_steps: Number of steps for image generation.
  • image_gen_model_id: Identifier for the Stable Diffusion model.
  • image_gen_size: Size of the generated image.
  • image_gen_guidance_scale: Scale for guiding image generation.
  • prompt_gen_model_id: Identifier for the GPT-3 model.
  • prompt_dataset_size: Size of the dataset for generating prompts.
  • prompt_max_length: Maximum length of generated prompts.

Image Generation

The generate_image function takes a textual prompt and a model as input and generates an image based on the prompt using the Stable Diffusion technique.

Usage

  1. Set up the configuration parameters in the CFG class according to your requirements.
  2. Call the generate_image function with the desired prompt and model to generate an image.

References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published