SDXL Lora

sdxl-controlnet-lora-small

SDXL Lora is a specialized AI model for generating high-quality images with SDXL-style enhancements, perfect for creative professionals.

L40S 45GB
Fast Inference
REST API

Model Information

Response Time~0 sec
StatusActive
Version
0.0.1
Updated12 days ago

Prerequisites

  • Create an API Key from the Eachlabs Console
  • Install the required dependencies for your chosen language (e.g., requests for Python)

API Integration Steps

1. Create a Prediction

Send a POST request to create a new prediction. This will return a prediction ID that you'll use to check the result. The request should include your model inputs and API key.

import requests
import time
API_KEY = "YOUR_API_KEY" # Replace with your API key
HEADERS = {
"X-API-Key": API_KEY,
"Content-Type": "application/json"
}
def create_prediction():
response = requests.post(
"https://api.eachlabs.ai/v1/prediction/",
headers=HEADERS,
json={
"model": "sdxl-controlnet-lora-small",
"version": "0.0.1",
"input": {
"seed": null,
"image": "your_file.image/jpeg",
"prompt": "An astronaut riding a rainbow unicorn",
"img2img": false,
"strength": "0.8",
"scheduler": "K_EULER",
"lora_scale": "0.95",
"num_outputs": "1",
"lora_weights": "your lora weights here",
"guidance_scale": "7.5",
"condition_scale": "1.1",
"negative_prompt": "your negative prompt here",
"ip_adapter_scale": "1",
"num_inference_steps": "30",
"auto_generate_caption": false,
"generated_caption_weight": "0.5"
}
}
)
prediction = response.json()
if prediction["status"] != "success":
raise Exception(f"Prediction failed: {prediction}")
return prediction["predictionID"]

2. Get Prediction Result

Poll the prediction endpoint with the prediction ID until the result is ready. The API uses long-polling, so you'll need to repeatedly check until you receive a success status.

def get_prediction(prediction_id):
while True:
result = requests.get(
f"https://api.eachlabs.ai/v1/prediction/{prediction_id}",
headers=HEADERS
).json()
if result["status"] == "success":
return result
elif result["status"] == "error":
raise Exception(f"Prediction failed: {result}")
time.sleep(1) # Wait before polling again

3. Complete Example

Here's a complete example that puts it all together, including error handling and result processing. This shows how to create a prediction and wait for the result in a production environment.

try:
# Create prediction
prediction_id = create_prediction()
print(f"Prediction created: {prediction_id}")
# Get result
result = get_prediction(prediction_id)
print(f"Output URL: {result['output']}")
print(f"Processing time: {result['metrics']['predict_time']}s")
except Exception as e:
print(f"Error: {e}")

Additional Information

  • The API uses a two-step process: create prediction and poll for results
  • Response time: -
  • Rate limit: 60 requests/minute
  • Concurrent requests: 10 maximum
  • Use long-polling to check prediction status until completion

Overview

SDXL Lora is a versatile and robust generative model designed for creating high-quality images using advanced control mechanisms like prompts, LoRA weights, and detailed configuration options. SDXL Lora is designed for both creative and technical users, offering easy-to-use settings to customize outputs for various needs. With a combination of text-to-image and image-to-image generation, SDXL Lora is optimized for flexibility and fine-tuned results.

Technical Specifications

High-Resolution Outputs: Capable of generating detailed images with exceptional clarity.

LoRA Integration: Enables flexible style customization through fine-tuned pre-trained weights.

Dynamic Control Mechanisms: Offers adjustable parameters for prompts, guidance, and conditioning to refine outputs.

Versatile Schedulers: Supports multiple schedulers to balance speed and quality according to user needs.

Optimized for Stability: Built to produce consistent and reproducible results across various configurations.

Key Considerations

Prompt Design for SDXL Lora: The quality and specificity of the prompt significantly impact the output. Use descriptive, concise, and context-rich prompts for the best results.

Negative Prompts: Utilize the negative_prompt input to exclude undesirable elements or styles from the generated image.

Scheduler Selection: Each scheduler offers different trade-offs between speed and quality. Experiment with schedulers like KarrasDPM for smoother results or DDIM for faster iterations.

Inference Steps: Higher values improve detail but increase generation time. Start with 50-150 steps for most use cases.

Seed Consistency: The seed input ensures reproducibility of outputs. For random variations, leave this parameter unset.

Tips & Tricks

Optimizing Input Parameters for SDXL Lora

  • Prompt and Negative Prompt:
    • Use detailed prompts for specific outputs (e.g., "a futuristic cityscape at sunset, vivid colors").
    • Add negative prompts for refining details (e.g., "blurry edges, low contrast").
  • Condition Scale:
    • Values closer to 2 give higher weight to prompts. Use this for detailed control.
    • For more creative freedom, keep this value closer to 1.
  • Strength:
    • Lower values (e.g., 0.3-0.5) retain more of the original image in Img2Img tasks.
    • Higher values (>0.7) allow for dramatic transformations.
  • Ip Adapter Scale:
    • Use this parameter to fine-tune how much the generated image adheres to the original image.
  • Inference Steps:
    • Start with 50-100 steps for general use cases.
    • For highly detailed outputs, use 150-200 steps. Avoid exceeding 300 unless necessary due to increased processing time.
  • Guidance Scale:
    • Higher values (20-30) create outputs that are more closely aligned with the prompt but may sacrifice creativity.
    • Use moderate values (10-20) for balanced outputs.
  • Scheduler:
    • DDIM: Best for faster results with acceptable quality.
    • KarrasDPM: Ideal for smooth and high-quality outputs.
    • HeunDiscrete: Provides a good balance between speed and fidelity.
  • LoRA Scale:
    • Use values around 0.5-0.7 for subtle stylistic changes.
    • For strong LoRA influences, increase the scale closer to 1.

Best Practices for Auto Captioning with SDXL Lora

  • Enable auto_generate_caption when working with complex images to ensure proper context is integrated into the prompt.
  • Adjust the generated_caption_weight to control how much the caption influences the final output.

Capabilities

Text-to-Image Generation with SDXL Lora: Create photorealistic or stylized images based on textual descriptions using the prompt and negative_prompt inputs.

Image-to-Image Transformation: Modify or enhance existing images with the Img2Img feature for tailored edits.

Fine Control: Adjustable parameters like guidance_scale, scheduler, and condition_scale allow users to fine-tune the model’s behavior for specific outputs.

LoRA Integration: Leverage LoRA weights and scales to add unique styles or apply pre-trained configurations for specialized outputs.

Auto Captioning with SDXL Lora: Automatically generate captions for images and integrate them into prompts for enhanced context.

Customizable Inference: Control the number of steps, outputs, and guidance levels for precision in image generation.

What can I use for?

SDXL Lora generates concept art, storyboards, and illustrations.

SDXL Lora transforms existing visuals for creative projects or enhancements.

SDXL Lora creates detailed and context-aware captions for media assets.

Things to be aware of

Experiment with combining detailed prompts and LoRA weights to create unique visual styles.

Use the Img2Img feature with low strength values for subtle enhancements of existing images.

Test different schedulers to understand their effect on speed and quality.

Limitations

High Resource Requirement: Generating detailed images with higher steps and guidance scales may require significant computational resources.

Prompt Sensitivity: Overly generic prompts can lead to less accurate or predictable results.

Limited LoRA Integration: Effectiveness depends on the quality of the pre-trained LoRA weights used.

Output Format: PNG

Related AI Models

flux-redux-dev

Flux Redux Dev

flux-redux-dev

Image to Image
recraft-creative-upscale

Recraft Creative Upscale

recraft-creative-upscale

Image to Image
illusion-diffusion-hq

Illusion Diffusion

illusion-diffusion-hq

Image to Image
flux-depth-pro

Flux Depth Pro

flux-depth-pro

Image to Image