Scan, Extract & Call
Stop typing numbers manually. Point your camera at business cards, docs, or screens to extract and dial numbers instantly.
Get Scan2Call π±Text-only prompts are often insufficient for precise image editing when camera perspective matters. To solve this, I built a camera-controlled AI image editing system using Qwen Image Edit 2511 with a Multiple-Angles LoRA adapter, backed by a FastAPI inference server and a lightweight browser UI.
This system allows users to upload a reference image, select camera angle, lighting, and shot type, and generate diffusion-optimized prompts automatically β all running locally.
Why Camera Control Matters in AI Image Editing
Text prompts alone are ambiguous for viewpoint changes
Camera angle consistency preserves subject identity
LoRA-based camera control improves edit accuracy
Local inference ensures privacy and predictability
The project is split into two independent repositories:
Frontend UI β Camera selection + prompt generation
Backend API β Qwen Image Edit inference server
Browser UI (HTML/JS)
β
Prompt Generator
β
FastAPI Backend
β
Qwen Image Edit 2511 + LoRA
β
Edited Image Output
The frontend is intentionally simple β no framework, no cloud dependencies. It generates diffusion-safe camera prompts.
function generatePrompt() {
const angle = document.getElementById('cameraAngle').value;
const height = document.getElementById('cameraHeight').value;
const shot = document.getElementById('shotType').value;
const lighting = document.getElementById('lighting').value;
return ` ${angle}, ${height}, ${shot}, ${lighting}, realistic perspective, same subject, consistent identity`;
}
const response = await fetch('http://localhost:8000/generate', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
prompt: generatePrompt(),
reference_image: uploadedImageBase64,
guidance_scale: 1.0,
num_inference_steps: 4,
height: 768,
width: 768
})
});
const data = await response.json();
displayOutputImage(data.image);
The backend is a FastAPI server optimized for 8GB VRAM GPUs. It loads Qwen Image Edit once and reuses the pipeline across requests.
from fastapi import FastAPI
from app.schemas import GenerateRequest
from app.inference import generate_image
app = FastAPI()
@app.post("/generate")
async def generate(req: GenerateRequest):
image, seed = generate_image(req)
return {
"success": True,
"image": image,
"seed": seed
}
pipe = QwenImageEditPipeline.from_pretrained(
MODEL_ID,
torch_dtype=torch.float16
).to("cuda")
pipe.enable_attention_slicing()
pipe.enable_vae_slicing()
result = pipe(
prompt=prompt,
image=reference_image,
num_inference_steps=steps,
guidance_scale=guidance
)
@app.get("/health")
def health():
return {
"status": "ok",
"gpu_available": torch.cuda.is_available(),
"model_loaded": pipe is not None
}
FP16 inference
Attention slicing
VAE slicing
768Γ768 resolution limit
Stateless request handling
These optimizations allow stable inference on GPUs like RTX 3060 / 4070 Laptop.
Unlike cloud-based AI tools:
No image uploads to third-party servers
No prompt logging
No telemetry
Full local execution
This makes the system suitable for internal tools, R&D, and sensitive workflows.
Camera-aware prompt engineering is the next step in controllable AI image editing. By separating UI, prompt logic, and inference, this architecture remains scalable, privacy-friendly, and production-ready.
If youβre exploring advanced diffusion workflows, Qwen Image Edit with camera control offers an excellent balance of power and efficiency.
LLM integration, OCR, and on-device AI engineering from Staksoft.