F L U X.1 dev Lo R A Children Simple Sketch

Shakker-Labs

Introduction

FLUX.1-DEV-LORA-CHILDREN-SIMPLE-SKETCH is a LoRA (Low-Rank Adaptation) model trained on FLUX.1-dev. It specializes in generating children's simple sketch-style images using text prompts. The model was developed by Hongke and is available through Shakker AI and Hugging Face.

Architecture

The model leverages the FLUX.1-dev architecture, employing LoRA techniques to adapt pre-trained models for specific tasks like generating sketched-style images. It uses diffusers for image generation and safetensors for efficient storage and loading of weights.

Training

The model was trained using the FLUX.1-dev base model. It focuses on generating images in a sketched style, suitable for creating child-like drawings with a touch of innocence and romance. The training process involved fine-tuning the model with specific datasets to optimize it for generating images based on given prompts.

Guide: Running Locally

  1. Install Dependencies:

    • Ensure you have Python and PyTorch installed.
    • Install the diffusers library. You can do this via pip:
      pip install diffusers
      
  2. Load the Model:

    • Use the following Python script to load and run the model:
      import torch
      from diffusers import FluxPipeline
      
      pipe = FluxPipeline.from_pretrained("black-forest-labs/FLUX.1-dev", torch_dtype=torch.bfloat16)
      pipe.load_lora_weights("Shakker-Labs/FLUX.1-dev-LoRA-Children-Simple-Sketch", weight_name="FLUX-dev-lora-children-simple-sketch.safetensors")
      pipe.fuse_lora(lora_scale=1.5)
      pipe.to("cuda")
      
      prompt = "sketched style,A joyful girl with balloons floats above a city wearing a hat and striped pants,"
      
      image = pipe(prompt, 
                   num_inference_steps=24, 
                   guidance_scale=3.5,
                  ).images[0]
      image.save(f"example.png")
      
  3. Execution Environment:

    • It is recommended to use a GPU for faster inference. Consider using cloud GPU services such as AWS EC2 with GPU instances, Google Cloud Platform, or NVIDIA's GPU Cloud.

License

This model is released under the flux-1-dev-non-commercial-license. For more details, please refer to the license document.

More Related APIs in Text To Image