A professional-grade image generation and photorealistic enhancement studio powered by Google AI Studio's Gemini API — built as a fully functional Blogger theme tool.
Your generated image will appear here. Enter a prompt and click Generate.
+
API Ready
·
Awaiting input
✨
Image Enhancer
📸
Upload image to enhance
PNG, JPEG, WEBP — max 20MB
Same2×4K8K16K
SubtleBalancedAggressive
True-to-Life Fidelity Mode
No Perspective Shifts
Suppress Text / Graphics
Suppress Hallucinated Detail
Face Detail Preservation
Skin Tone Accuracy
Edge Sharpness Recovery
📷 Original
BEFORE
Upload an image
—
Resolution
—
File Size
✨ Enhanced Output
AFTER
Analyzing image...
Result will appear here
—
Enhanced Res
—
Quality Score
📖 Integration — Google AI Studio
NeuralCanvas calls Google's Gemini 2.0 Flash model via the AI Studio REST API for both image generation and enhancement. Your API key is used client-side only and never stored.
// ── IMAGE GENERATION via Gemini 2.0 Flash ──────────────────────────────constgenerateImage = async (prompt, apiKey, options) => {
const res = await fetch(
`https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-preview-image-generation:generateContent?key=${apiKey}`,
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
contents: [{
parts: [{ text: buildPrompt(prompt, options) }]
}],
generationConfig: {
responseModalities: ["TEXT", "IMAGE"],
temperature: options.creativity ?? 0.7,
}
})
}
);
const data = await res.json();
// Extract base64 image from responseconst imgPart = data.candidates[0].content.parts
.find(p => p.inlineData);
return`data:image/png;base64,${imgPart.inlineData.data}`;
};
// ── IMAGE ENHANCEMENT (Photorealistic, Fidelity-locked) ─────────────────constenhanceImage = async (base64Image, apiKey, options) => {
const FIDELITY_SYSTEM = `
You are a photorealistic image upscaler.
STRICT RULES — NO exceptions:
1. Output must be a pixel-perfect upscale of the input.
2. Zero hallucinations, zero new details not in original.
3. No stylization, no perspective shifts, no text/graphics.
4. No color grading changes beyond requested enhancement.
5. Preserve all faces, textures, edges exactly.
6. Output must be photorealistic, sharp, high-resolution.
`;
const res = await fetch(
`https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash-preview-image-generation:generateContent?key=${apiKey}`,
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
system_instruction: { parts: [{ text: FIDELITY_SYSTEM }] },
contents: [{
parts: [
{ inlineData: { mimeType: 'image/jpeg', data: base64Image } },
{ text: buildEnhancePrompt(options) }
]
}],
generationConfig: {
responseModalities: ["IMAGE"],
temperature: 0.1, // Very low for fidelity
}
})
}
);
returnawaitextractImage(res);
};