Edit model card

DreamBooth LoRA Training with Stable Diffusion XL on Trump Thumbs Up Images

This repository contains instructions and code for training a DreamBooth LoRA model using Stable Diffusion XL on a dataset of images featuring Donald Trump giving a thumbs up gesture. The trained model can be used to generate high-quality images of Trump showing thumbs up in various contexts.

Sample Images

Here are a few sample images generated by the trained model:

Trump Thumbs Up in India

    1. A high quality picture of Trump showing thumbs up in a busy street of India, detailed, sharp focus.

Trump Thumbs Up in a Taco Restaurant

    1. An intricately detailed digital painting of Donald Trump giving a thumbs up at a taco restaurant. The background includes colorful decor and a bustling atmosphere with people enjoying their meals.

Trump Thumbs Up at the Beach

    1. A high-quality photo of Donald Trump giving a thumbs up on a sunny beach. The scene includes clear blue water, white sand, and Trump in casual beachwear. The image is detailed, with Trump’s smiling face and the vibrant beach setting in sharp focus.

Requirements

The script requires Python 3.9 and several Python packages including PyTorch, Hugging Face Transformers, Diffusers, and Accelerate. Additional dependencies are listed in the requirements_sdxl.txt file.

Installation

To get started, clone the repository and navigate to the project directory. Install the required packages using pip and the provided requirements_sdxl.txt file. Log in to the Hugging Face Hub using the huggingface-cli login command.

Usage

To train the model, prepare a dataset of images featuring Donald Trump giving a thumbs up gesture and place them in a directory. Run the training script train_dreambooth_lora_sdxl.py with the appropriate command-line arguments specifying the pretrained model, instance data directory, output directory, and various training hyperparameters.

After training, load the trained LoRA weights and use the DiffusionPipeline class from the Diffusers library to generate images. Provide a prompt describing the desired image, such as "A high quality picture of Trump showing the thumbs up in Paris detailed, sharp focus". The generated image will be saved to the specified output directory.

API Server

SDXL_API_Server contains the server side code containing the below information :

  • Image Generation Endpoint:

    • /generate_image: Accepts POST requests with prompts to generate Trump thumbs up images.
    • Users provide prompts describing desired image contexts.
    • Images are generated using a pre-trained model.
  • API Key Authentication:

    • Ensures presence of API key for authorization.
    • Rejects unauthorized requests.
  • API Key Usage Tracking:

    • Tracks API key usage count.
    • /api_key_usage endpoint retrieves usage count.
  • The Generated Output in postman:

    • POST Output
    • Endpoint to get generated images via a prompt using the above trigger keyword and style
    • Api_Key_Counts
    • Server maintains a count of each time the API key was used to successfully generate an image.

Results

The generated images will be saved in the specified output directory, showcasing Trump giving a thumbs up gesture in different contexts based on the provided prompts.

Downloads last month
0
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Model tree for Paresh1879/stable-diffusion-xl-thumbsup-extend

Finetuned
(1032)
this model

Space using Paresh1879/stable-diffusion-xl-thumbsup-extend 1