PixelForge × Webstuffies
Upload your image. Watch it morph into a 3D printable model. STL format, ready to print, gift, or brand.
Your STL preview will appear here after conversion.
Download the PixelForge Badge
from google import genai
from google.genai import types
from PIL import Image
from io import BytesIO
client = genai.Client()
prompt = (
“Create a picture of a nano banana dish in a fancy restaurant with a Gemini theme”
)
response = client.models.generate_content(
model=”gemini-2.5-flash-image”,
contents=[prompt],
)
for part in response.candidates[0].content.parts:
if part.text is not None:
print(part.text)
elif part.inline_data is not None:
image = Image.open(BytesIO(part.inline_data.data))
image.save(“generated_image.png”)
const express = require(‘express’);
const multer = require(‘multer’);
const { exec } = require(‘child_process’);
const app = express();
const upload = multer({ dest: ‘uploads/’ });
app.post(‘/upload’, upload.single(‘image’), (req, res) => {
const imagePath = req.file.path;
// Call your Python script to process the image and create 3D models
exec(`python3 process_image.py ${imagePath}`, (error, stdout, stderr) => {
if (error) return res.status(500).send(‘Error processing image’);
// stdout should contain paths to STL, OBJ, 3MF files
const [stl, obj, mf3] = stdout.trim().split(‘\n’);
res.json({ stl, obj, mf3 });
});
});
app.listen(3000, () => console.log(‘Server started on port 3000’));