SDXL Ad Inpaint
sdxl-ad-inpaint
Product advertising image generator using SDXL
Model Information
Input
Configure model parameters
Output
View generated results
Result
Preview, share or download your results with a single click.

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 requestsimport timeAPI_KEY = "YOUR_API_KEY" # Replace with your API keyHEADERS = {"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-ad-inpaint","version": "0.0.1","input": {"seed": null,"image": "your_file.image/jpeg","prompt": "your prompt here","img_size": "1024, 1024","apply_img": "True","scheduler": "K_EULER","product_fill": "Original","guidance_scale": "7.5","condition_scale": "0.9","negative_prompt": "low quality, out of frame, illustration, 3d, sepia, painting, cartoons, sketch, watermark, text, Logo, advertisement","num_refine_steps": "10","num_inference_steps": "40"}})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 resultelif 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 predictionprediction_id = create_prediction()print(f"Prediction created: {prediction_id}")# Get resultresult = 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: ~20 seconds
- Rate limit: 60 requests/minute
- Concurrent requests: 10 maximum
- Use long-polling to check prediction status until completion
Overview
The SDXL Ad Inpaint Model is a sophisticated solution designed for image inpainting tasks, particularly effective in restoring, editing, or refining visual content with precision. Built with advanced deep learning, this model delivers high-quality results for reconstructing and enhancing images. By fine-tuning prompts and adjusting settings, users can create a wide variety of detailed and personalized outcomes with SDXL Ad Inpaint.
Technical Specifications
Advanced Guidance Mechanisms: Supports both guidance_scale and condition_scale for precise control over image generation.
Dynamic Refinement Steps: The num_refine_steps input allows fine-tuning of the inpainting process.
Versatile Scheduler Support: Options like KarrasDPM and PNDM enable flexible optimization strategies.
High-Resolution Support: Designed to handle various resolutions efficiently with adjustable img_size.
Key Considerations
Prompt Dependent Results:
Model output is highly dependent on the clarity and detail of the prompt provided.
Resource Consumption:
Higher values for parameters such as num_inference_steps can increase processing time.
Avoid Oversaturation:
Using extreme values for guidance_scale or condition_scale can result in oversaturated or unnatural output.
Seed Variability:
Setting a consistent seed ensures repeatable results, while leaving it random allows for creative exploration.
Tips & Tricks
Optimizing Parameters for Best Results for SDXL Ad Inpaint
- product_fill: Start with Original for retaining the base image's structure. Gradually experiment with values like 80 or 70 for creative enhancements.
- scheduler:
- Use KarrasDPM for smooth gradients and high detail.
- Opt for DDIM if faster iterations are preferred.
- num_inference_steps: Ideal range is 5-10 for a balance between speed and quality.
- guidance_scale: A value of 15-25 works well for most cases, while lower values may produce subtler changes.
- condition_scale: Stay within 0.5-0.7 for controlled refinement. Values above or below may affect image fidelity.
- num_refine_steps: Begin with 20 for detailed adjustments, increasing up to 40 for intricate edits.
Prompt Crafting with SDXL Ad Inpaint
- Use concise and descriptive language.
- Include specific elements or styles you wish to emphasize. For example: “A serene sunset over a mountain lake”.
- Avoid overly technical or contradictory descriptions.
Experiment with Upscaling
- Enable upscale for sharper, high-resolution results.
- Adjust upscale_steps (e.g., 10-15) to find the ideal balance between clarity and computation time.
Leverage Seed Control
- For repeatable results, set a fixed seed. For example, 12345 is a good starting point.
- To explore variations, leave the seed unset or randomly generate values.
Capabilities
Restoration: Repair damaged or incomplete images effectively.
Enhancement: Add details, improve textures, or refine existing visuals.
Creative Edits: Generate artistic interpretations or stylized outputs from base images.
What can I use for?
Visual Storytelling: Create compelling visuals for narratives or presentations.
Advertising: Enhance product images with custom edits.
Content Creation: Produce high-quality visuals for media, design, or personal use.
Things to be aware of
Adjust Prompt Styles: Experiment with creative prompts like “A futuristic cityscape at dusk” to explore the model's artistic potential.
Explore Schedulers: Test different schedulers like PNDM or HeunDiscrete for unique results.
Combine Features: Use apply_img with specific condition_scale values for controlled blending of original and generated content.
Limitations
Complex Scenes
Rendering complex or highly detailed scenes may require additional optimization.
Prompt Sensitivity
SDXL Ad Inpaint's performance can vary significantly depending on the prompt provided.
Processing Time
Large images or high parameter values can lead to longer processing times.
Edge Cases
Some specific styles or transformations may not align perfectly with the model’s design.
Output Format: PNG