SDXL Base (Standard Model)
SDXL Base is our high-quality image generation model that produces production-ready images with exceptional detail and accuracy. Based on Stability AI's SDXL architecture, this model excels at creating professional-grade visuals.
Model Overview
Technical Specifications
- Provider: Stability AI
- Model: Stable Diffusion XL Base 1.0
- Resolution: Up to 1024x1024
- Default Steps: 20 (configurable)
- Default Guidance: 7.5 (configurable)
- License: Stable Diffusion Research License
- Model Card: SDXL Base on Hugging Face
Basic Usage
import { Neuredge } from '@neuredge/sdk';
const neuredge = new Neuredge({
apiKey: 'your-api-key'
});
const image = await neuredge.generateImage({
model: '@cf/stabilityai/stable-diffusion-xl-base-1.0',
prompt: 'A detailed oil painting of a medieval castle at sunset',
width: 1024,
height: 1024,
num_steps: 20,
guidance: 7.5
});
Real-World Applications & Examples
1. Professional Photography Simulation
async function generateProductPhoto(product) {
const response = await neuredge.generateImage({
model: '@cf/stabilityai/stable-diffusion-xl-base-1.0',
prompt: \`Professional studio photography of ${product.name},
${product.color} color, on seamless white background,
product photography lighting, high-end commercial quality,
4k resolution, detailed textures\`,
width: 1024,
height: 1024,
num_steps: 25, // Increased steps for better quality
guidance: 8.0 // Higher guidance for more photorealism
});
return response;
}
Use Cases:
- E-commerce photography
- Product catalogs
- Marketing materials
- Portfolio imagery
- Sales collateral
2. Architectural Visualization
async function generateArchitecturalRender(design) {
const response = await neuredge.generateImage({
model: '@cf/stabilityai/stable-diffusion-xl-base-1.0',
prompt: \`Modern ${design.style} architecture, ${design.building_type},
exterior view, natural lighting, photorealistic rendering,
professional architectural visualization,
${design.materials.join(', ')}, landscaping details\`,
width: 1024,
height: 1024,
num_steps: 30, // Maximum quality for architecture
guidance: 7.75 // Balanced realism and creativity
});
return response;
}
Use Cases:
- Building designs
- Real estate listings
- Development proposals
- Design presentations
- Construction planning
3. Brand Asset Creation
async function generateBrandAsset(brand) {
const response = await neuredge.generateImage({
model: '@cf/stabilityai/stable-diffusion-xl-base-1.0',
prompt: \`${brand.style} style ${brand.assetType},
brand colors: ${brand.colors.join(', ')},
${brand.mood} mood, commercial quality,
professional lighting, ${brand.additional_details}\`,
width: 1024,
height: 1024,
num_steps: 20,
guidance: 7.5
});
return response;
}
Use Cases:
- Marketing visuals
- Social media content
- Advertising materials
- Brand guidelines
- Promotional assets
Integration Examples
Express.js with Image Processing
import express from 'express';
import sharp from 'sharp';
import { Neuredge } from '@neuredge/sdk';
const app = express();
app.use(express.json());
const neuredge = new Neuredge({
apiKey: process.env.NEUREDGE_API_KEY
});
app.post('/generate-and-process', async (req, res) => {
try {
const { prompt, format = 'jpeg', quality = 90 } = req.body;
// Generate image
const response = await neuredge.generateImage({
model: '@cf/stabilityai/stable-diffusion-xl-base-1.0',
prompt,
width: 1024,
height: 1024,
num_steps: 20
});
// Process image using Sharp
const buffer = await response.arrayBuffer();
const processedImage = await sharp(buffer)
.format(format)
.quality(quality)
.toBuffer();
res.setHeader('Content-Type', \`image/\${format}\`);
res.send(processedImage);
} catch (error) {
res.status(500).json({ error: error.message });
}
});
Next.js Image Gallery
// pages/api/gallery.js
import { Neuredge } from '@neuredge/sdk';
const neuredge = new Neuredge({
apiKey: process.env.NEUREDGE_API_KEY
});
export default async function handler(req, res) {
if (req.method !== 'POST') {
return res.status(405).json({ message: 'Method not allowed' });
}
try {
const { prompts } = req.body;
const images = await Promise.all(
prompts.map(prompt =>
neuredge.generateImage({
model: '@cf/stabilityai/stable-diffusion-xl-base-1.0',
prompt,
width: 1024,
height: 1024,
num_steps: 20
})
)
);
const base64Images = await Promise.all(
images.map(async img => {
const buffer = await img.arrayBuffer();
return Buffer.from(buffer).toString('base64');
})
);
res.json({
images: base64Images.map(base64 =>
\`data:image/png;base64,\${base64}\`
)
});
} catch (error) {
res.status(500).json({ error: error.message });
}
}
Best Practices
-
Prompt Engineering
- Be specific and detailed
- Include desired artistic style
- Specify lighting conditions
- Mention quality expectations
- Include composition details
-
Quality Optimization
- Adjust steps based on complexity
- Fine-tune guidance scale
- Consider image resolution
- Balance parameters
-
Performance
- Cache generated images
- Implement retry logic
- Handle errors gracefully
- Monitor generation times
-
Resource Management
- Track usage quotas
- Optimize batch requests
- Implement rate limiting
- Monitor costs
Parameters Guide
Parameter | Range | Description |
---|---|---|
num_steps | 10-30 | Higher values = more detail |
guidance | 5.0-10.0 | Higher values = closer to prompt |
width | 512-1024 | Image width in pixels |
height | 512-1024 | Image height in pixels |
When to Use
✅ Ideal For:
- Professional work
- Client deliverables
- Marketing content
- Brand assets
- High-quality visuals
❌ Consider Alternatives When:
- Rapid iteration needed
- Quick drafts required
- Testing concepts
- Limited time/budget
Getting Started
- Install the SDK:
npm install @neuredge/sdk
# or
pip install neuredge-sdk
- Set up your environment:
NEUREDGE_API_KEY=your-api-key
- Initialize the client:
import { Neuredge } from '@neuredge/sdk';
const neuredge = new Neuredge({
apiKey: process.env.NEUREDGE_API_KEY
});
Learn more: