Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/%22script.js/%22https:/editorjs.io/configuration//%22?q=image&page=1&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=image

Returns an array of strings in format "username" or "username/projectName"

Found 12770 results for "image"(1726ms)

val-town-http-mcp-servervalley.txt2 matches

@charmaineโ€ขUpdated 33 mins ago
169
170- **Redirects:** Use `return new Response(null, { status: 302, headers: { Location: "/place/to/redirect" }})` instead of `Response.redirect` which is broken
171- **Images:** Avoid external images or base64 images. Use emojis, unicode symbols, or icon fonts/libraries instead
172- **AI Image:** To inline generate an AI image use: `<img src="https://maxm-imggenurl.web.val.run/the-description-of-your-image" />`
173- **Storage:** DO NOT use the Deno KV module for storage
174- **Browser APIs:** DO NOT use the `alert()`, `prompt()`, or `confirm()` methods

val-town-http-mcp-servervalley_local.txt2 matches

@charmaineโ€ขUpdated 33 mins ago
33// These are critical requirements for Val Town
34* Response.redirect is broken. Use return new Response(null, { status: 302, headers: { Location: "/place/to/redirect" }})
35* Avoid external images or base64 images when possible
36* For AI-generated images, use: https://maxm-imggenurl.web.val.run/[description]
37* DO NOT use Deno KV module, alert(), prompt(), or confirm() methods
38* For weather data, use open-meteo (no API key required)

val-town-http-mcp-servertownie.txt2 matches

@charmaineโ€ขUpdated 33 mins ago
18 * Response.redirect is broken. Use `return new Response(null, { status: 302, headers: { Location: "/place/to/redirect" }})`
19
20 * Avoid external images or base64 images, use emojis, unicode symtols, or icon fonts/libraries instead, unless that's not practical for the user's request (e.g. if they ask for a particular animated gif).
21
22 * If you want an AI generated image, use https://maxm-imggenurl.web.val.run/the-description-of-your-image to dynamically generate one.
23
24 * DO NOT use the Deno KV module for storage.

val-town-http-mcp-serverprojectTools.ts4 matches

@charmaineโ€ขUpdated 33 mins ago
124 description: z.string().max(64).optional()
125 .describe("Description for the project (optional, max 64 characters)"),
126 imageUrl: z.string().optional().describe("URL to an image for the project (optional)"),
127 },
128 async ({name, privacy, description, imageUrl}: {
129 name: string
130 privacy: "public" | "unlisted" | "private"
131 description?: string
132 imageUrl?: string
133 }) => {
134 try {
159 privacy,
160 ...(description ? {description} : {}),
161 ...(imageUrl ? {imageUrl} : {}),
162 }
163

val-town-http-mcp-serveropentownie.txt2 matches

@charmaineโ€ขUpdated 33 mins ago
101## Val Town Platform Specifics
102- **Redirects:** Use `return new Response(null, { status: 302, headers: { Location: "/place/to/redirect" }})` instead of `Response.redirect` which is broken
103- **Images:** Avoid external images or base64 images. Use emojis, unicode symbols, or icon fonts/libraries instead
104- For AI-generated images, use: `https://maxm-imggenurl.web.val.run/the-description-of-your-image`
105- **Storage:** DO NOT use the Deno KV module for storage
106- **Browser APIs:** DO NOT use the `alert()`, `prompt()`, or `confirm()` methods
Gemini-Nano-Banana-03

Gemini-Nano-Banana-03main.tsx41 matches

@aibotcommanderโ€ขUpdated 46 mins ago
1/* Generate beautifull, high quality images: https://poe.com/Gemini-Nano-Banana */
2
3import process from "node:process";
4import { OpenAI } from "npm:openai";
5const IMAGE_COST = 500;
6
7interface ModelConfig {
12}
13
14const IMAGE_MODEL: ModelConfig = {
15 provider: "google",
16 model: "gemini-2.5-flash-image-preview",
17 endpoint:
18 "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-image-preview:generateContent",
19 headers: {
20 "Content-Type": "application/json",
35}
36
37function extractImageUrl(content: string): string | null {
38 // Extract URLs from POE response
39 const urlMatch = content.match(/https?:\/\/[^\s]+\.(jpg|jpeg|png|gif|webp)/i);
40 if (urlMatch) return urlMatch[0];
41
42 // Extract markdown image format
43 const mdMatch = content.match(/!\[.*?\]\((https?:\/\/[^\)]+)\)/);
44 if (mdMatch) return mdMatch[1];
49}
50
51async function generateImageWithPoe(
52 prompt: string,
53 send: SendEventFn
60
61 try {
62 console.log(`Attempting Poe image generation with API key ${keyNumber}`);
63
64 const poeClient = createPoeClient(apiKey);
65 const imagePrompt = `Generate high-quality image: ${prompt}`;
66
67 const chat = await poeClient.chat.completions.create({
68 model: "FLUX-schnell-DI",
69 messages: [{ role: "user", content: imagePrompt }],
70 max_tokens: 1024,
71 temperature: 0.8,
75
76 if (content) {
77 const imageUrl = extractImageUrl(content);
78
79 if (imageUrl) {
80 send("text", {
81 text: `๐ŸŽจ **Image Generated Successfully!**\n\n![Generated Image](${imageUrl})*`
82 });
83 return;
84 } else {
85 // If no URL found, send the content as-is (might contain image data or instructions)
86 send("text", {
87 text: `๐ŸŽจ **Image Generated!**\n\n${content}`
88 });
89 return;
106 console.error("All API keys failed:", lastError);
107 send("error", {
108 text: `Image generation failed: All Poe API keys exhausted. Last error: ${lastError?.message || 'Unknown error'}. Please try a different prompt.`,
109 allow_retry: true
110 });
125 },
126 body: JSON.stringify({
127 model: "google/gemini-2.5-flash-image-preview",
128 messages: [
129 {
144
145 if (content) {
146 const imageUrl = extractImageUrl(content);
147
148 if (imageUrl) {
149 send("text", {
150 text: `๐ŸŽจ **Image Generated Successfully!**\n\n![Generated Image](${imageUrl})`
151 });
152 } else {
153 send("text", {
154 text: `๐ŸŽจ **Image Generated!**\n\n${content}`
155 });
156 }
165}
166
167async function generateImage(
168 prompt: string,
169 send: SendEventFn
181
182 // Try Gemini
183 const imagePrompt = `Detailed image: ${prompt}.`;
184
185 const payload = {
186 contents: [{
187 role: "user",
188 parts: [{ text: imagePrompt }]
189 }],
190 generationConfig: {
195 };
196
197 const url = `${IMAGE_MODEL.endpoint}?key=${process.env.GEMINI_API_KEY}`;
198
199 const response = await fetch(url, {
200 method: "POST",
201 headers: IMAGE_MODEL.headers,
202 body: JSON.stringify(payload),
203 });
204
205 if (!response.ok) {
206 console.warn("Gemini image generation failed");
207 await generateImageWithPoe(prompt, send);
208 return;
209 }
213
214 if (generatedContent) {
215 const imageUrl = extractImageUrl(generatedContent);
216
217 if (imageUrl) {
218 send("text", {
219 text: `๐ŸŽจ **Image Generated Successfully!**\n\n![Generated Image](${imageUrl})\n\n*Generated using Gemini-2.5-Flash-Image-Preview*`
220 });
221 } else {
222 send("text", {
223 text: `๐ŸŽจ **Image Generated!**\n\n${generatedContent}\n\n*Generated using Gemini-2.5-Flash-Image-Preview*`
224 });
225 }
226 } else {
227 console.warn("No content from Gemini");
228 await generateImageWithPoe(prompt, send);
229 }
230
231 } catch (error) {
232 console.error("Primary image generation error:", error);
233 console.warn("Attempting Poe fallback");
234 await generateImageWithPoe(prompt, send);
235 }
236}
267 const lastUserMessage = messages.filter((m) => m.role === "user").pop();
268 if (!lastUserMessage) {
269 await generateImage("Welcome! I'm an image generation bot. Here's a beautiful sunset landscape to start.", send);
270 send("done", {});
271 return;
276 if (!userContent || userContent.trim().length === 0) {
277 send("error", {
278 text: "Please provide a description for the image you'd like me to generate.",
279 allow_retry: false,
280 });
283 }
284
285 await generateImage(userContent, send);
286 send("done", {});
287}
289async function getBotSettings(): Promise<BotSettings> {
290 const rateCard = "| Type | Price |\n" + "|------|------|\n" +
291 `| Image Generation | ${IMAGE_COST} points |\n`;
292 const costLabel = `${IMAGE_COST} points`;
293
294 return {

zoomtestmain.js4 matches

@yawnxyzโ€ขUpdated 47 mins ago
573 <meta charset="UTF-8">
574 <meta name="viewport" content="width=device-width, initial-scale=1.0">
575 <link rel="icon" type="image/png" href="https://labspace.ai/ls2-circle.png" />
576 <title>Zoom RTMS App</title>
577 <meta property="og:title" content="Zoom RTMS App" />
578 <meta property="og:description" content="Real-time transcript analysis and OAuth integration for Zoom meetings" />
579 <meta property="og:image" content="https://yawnxyz-og.web.val.run/img?link=https://yawnxyz-zoom-rtms.web.val.run&title=Zoom+RTMS+Test&subtitle=Test+app+for+Zoom+OAuth+integration" />
580 <meta property="og:url" content="https://yawnxyz-zoom-rtms.web.val.run/" />
581 <meta property="og:type" content="website" />
582 <meta name="twitter:card" content="summary_large_image" />
583 <meta name="twitter:title" content="Zoom RTMS App" />
584 <meta name="twitter:description" content="Real-time transcript analysis and OAuth integration for Zoom meetings" />
585 <meta name="twitter:image" content="https://yawnxyz-og.web.val.run/img?link=https://yawnxyz-zoom-rtms.web.val.run&title=Zoom+RTMS+Test&subtitle=Test+app+for+Zoom+OAuth+integration" />
586 <script src="https://cdn.tailwindcss.com"></script>
587 <script>
Gemini-Nano-Banana-01

Gemini-Nano-Banana-01main.tsx41 matches

@aibotcommanderโ€ขUpdated 50 mins ago
1/* Generate beautifull, high quality images: https://poe.com/Gemini-Nano-Banana */
2
3import process from "node:process";
4import { OpenAI } from "npm:openai";
5const IMAGE_COST = 500;
6
7interface ModelConfig {
12}
13
14const IMAGE_MODEL: ModelConfig = {
15 provider: "google",
16 model: "gemini-2.5-flash-image-preview",
17 endpoint:
18 "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-image-preview:generateContent",
19 headers: {
20 "Content-Type": "application/json",
35}
36
37function extractImageUrl(content: string): string | null {
38 // Extract URLs from POE response
39 const urlMatch = content.match(/https?:\/\/[^\s]+\.(jpg|jpeg|png|gif|webp)/i);
40 if (urlMatch) return urlMatch[0];
41
42 // Extract markdown image format
43 const mdMatch = content.match(/!\[.*?\]\((https?:\/\/[^\)]+)\)/);
44 if (mdMatch) return mdMatch[1];
49}
50
51async function generateImageWithPoe(
52 prompt: string,
53 send: SendEventFn
60
61 try {
62 console.log(`Attempting Poe image generation with API key ${keyNumber}`);
63
64 const poeClient = createPoeClient(apiKey);
65 const imagePrompt = `Generate high-quality image: ${prompt}`;
66
67 const chat = await poeClient.chat.completions.create({
68 model: "FLUX-schnell-DI",
69 messages: [{ role: "user", content: imagePrompt }],
70 max_tokens: 1024,
71 temperature: 0.8,
75
76 if (content) {
77 const imageUrl = extractImageUrl(content);
78
79 if (imageUrl) {
80 send("text", {
81 text: `๐ŸŽจ **Image Generated Successfully!**\n\n![Generated Image](${imageUrl})*`
82 });
83 return;
84 } else {
85 // If no URL found, send the content as-is (might contain image data or instructions)
86 send("text", {
87 text: `๐ŸŽจ **Image Generated!**\n\n${content}`
88 });
89 return;
106 console.error("All API keys failed:", lastError);
107 send("error", {
108 text: `Image generation failed: All POE API keys exhausted. Last error: ${lastError?.message || 'Unknown error'}. Please try a different prompt.`,
109 allow_retry: true
110 });
125 },
126 body: JSON.stringify({
127 model: "google/gemini-2.5-flash-image-preview",
128 messages: [
129 {
144
145 if (content) {
146 const imageUrl = extractImageUrl(content);
147
148 if (imageUrl) {
149 send("text", {
150 text: `๐ŸŽจ **Image Generated Successfully!**\n\n![Generated Image](${imageUrl})\n\n*Generated using Flux 1.1 Pro via OpenRouter*`
151 });
152 } else {
153 send("text", {
154 text: `๐ŸŽจ **Image Generated!**\n\n${content}\n\n*Generated using Flux 1.1 Pro via OpenRouter*`
155 });
156 }
165}
166
167async function generateImage(
168 prompt: string,
169 send: SendEventFn
181
182 // Try Gemini
183 const imagePrompt = `Detailed image: ${prompt}.`;
184
185 const payload = {
186 contents: [{
187 role: "user",
188 parts: [{ text: imagePrompt }]
189 }],
190 generationConfig: {
195 };
196
197 const url = `${IMAGE_MODEL.endpoint}?key=${process.env.GEMINI_API_KEY}`;
198
199 const response = await fetch(url, {
200 method: "POST",
201 headers: IMAGE_MODEL.headers,
202 body: JSON.stringify(payload),
203 });
204
205 if (!response.ok) {
206 console.warn("Gemini image generation failed");
207 await generateImageWithPoe(prompt, send);
208 return;
209 }
213
214 if (generatedContent) {
215 const imageUrl = extractImageUrl(generatedContent);
216
217 if (imageUrl) {
218 send("text", {
219 text: `๐ŸŽจ **Image Generated Successfully!**\n\n![Generated Image](${imageUrl})\n\n*Generated using Gemini-2.5-Flash-Image-Preview*`
220 });
221 } else {
222 send("text", {
223 text: `๐ŸŽจ **Image Generated!**\n\n${generatedContent}\n\n*Generated using Gemini-2.5-Flash-Image-Preview*`
224 });
225 }
226 } else {
227 console.warn("No content from Gemini");
228 await generateImageWithPoe(prompt, send);
229 }
230
231 } catch (error) {
232 console.error("Primary image generation error:", error);
233 console.warn("Attempting Poe fallback");
234 await generateImageWithPoe(prompt, send);
235 }
236}
267 const lastUserMessage = messages.filter((m) => m.role === "user").pop();
268 if (!lastUserMessage) {
269 await generateImage("Welcome! I'm an image generation bot. Here's a beautiful sunset landscape to start.", send);
270 send("done", {});
271 return;
276 if (!userContent || userContent.trim().length === 0) {
277 send("error", {
278 text: "Please provide a description for the image you'd like me to generate.",
279 allow_retry: false,
280 });
283 }
284
285 await generateImage(userContent, send);
286 send("done", {});
287}
289async function getBotSettings(): Promise<BotSettings> {
290 const rateCard = "| Type | Price |\n" + "|------|------|\n" +
291 `| Image Generation | ${IMAGE_COST} points |\n`;
292 const costLabel = `${IMAGE_COST} points`;
293
294 return {

flowxo-http-bot-sampleindex.html1 match

@flowxoโ€ขUpdated 1 hour ago
14 rel="icon"
15 href="https://glitch.com/edit/favicon-app.ico"
16 type="image/x-icon"
17 > -->
18 <!-- import the webpage's stylesheet -->
Gemini-2-5-Pro-O-01

Gemini-2-5-Pro-O-01main.tsx61 matches

@aibotcommanderโ€ขUpdated 1 hour ago
2import { OpenAI } from "npm:openai";
3
4const IMAGE_COST = 400;
5const TEXT_COST = 400;
6const FILE_ANALYSIS_COST = 400;
44
45const POE_MODELS = {
46 imageGeneration: [
47 "Flux-schnell",
48 "Flux-schnell-DI",
49 "ImageCreatorSD",
50 "Free-GPT-Image-1"
51 ],
52 textGeneration: [
65 "Llama-3.1-8b-DI"
66 ],
67 imageAnalysis: [
68 "Qwen3-235B-A22B",
69 "Gemini-1.5-Flash",
118
119function selectOptimalTokens(contentLength: number, taskType: string): number {
120 if (taskType === "Image Generation") return 1024;
121 if (contentLength < 100) return 1024; // Short queries
122 if (contentLength < 500) return 1500; // Medium queries
130 taskType: string,
131 timeout: number = 15000,
132 isImageGeneration: boolean = false
133): Promise<string | null> {
134 try {
153 const content = message?.content;
154
155 if (isImageGeneration && message?.attachments && message.attachments.length > 0) {
156 const imageAttachment = message.attachments.find(att =>
157 att.content_type && att.content_type.startsWith('image/')
158 );
159 if (imageAttachment && imageAttachment.url) {
160 return imageAttachment.url;
161 }
162 }
175 taskType: string,
176 timeout: number = 15000,
177 isImageGeneration: boolean = false
178): Promise<string | null> {
179 // Try first 2 models in parallel for speed
187 for (const model of parallelModels) {
188 promises.push(
189 callSinglePoeModel(model, prompt, keyIndex, taskType, timeout, isImageGeneration)
190 .then(result => ({ result, model, keyIndex }))
191 );
203 console.log(`Success with ${successful.value.model} (API key ${successful.value.keyIndex + 1})`);
204
205 if (isImageGeneration) {
206 const urlMatch = successful.value.result.match(/https?:\/\/[^\s]+\.(jpg|jpeg|png|gif|webp)/i);
207 if (urlMatch) {
208 send("replace_response", {
209 text: `๐ŸŽจ **${taskType} by Gemini-2.5-Pro-Omni completed**\n\n![Generated Image](${urlMatch[0]})`
210 });
211 return urlMatch[0];
232 for (const model of remainingModels) {
233 for (let keyIndex = 0; keyIndex < POE_API_KEYS.length; keyIndex++) {
234 const result = await callSinglePoeModel(model, prompt, keyIndex, taskType, timeout, isImageGeneration);
235 if (result) {
236 if (isImageGeneration) {
237 const urlMatch = result.match(/https?:\/\/[^\s]+\.(jpg|jpeg|png|gif|webp)/i);
238 if (urlMatch) {
239 send("replace_response", {
240 text: `๐ŸŽจ **${taskType} by Gemini-2.5-Pro-Omni completed**\n\n![Generated Image](${urlMatch[0]})`
241 });
242 return urlMatch[0];
260}
261
262async function imageToBase64(imageUrl: string): Promise<{ data: string; mimeType: string }> {
263 try {
264 const response = await fetch(imageUrl, { timeout: 8000 });
265 if (!response.ok) {
266 throw new Error(`Failed to fetch image: ${response.status}`);
267 }
268 const arrayBuffer = await response.arrayBuffer();
269 const buffer = Buffer.from(arrayBuffer);
270 const mimeType = response.headers.get('content-type') || 'image/jpeg';
271 return { data: buffer.toString('base64'), mimeType: mimeType };
272 } catch (error) {
273 console.error('Error converting image to base64:', error);
274 throw error;
275 }
281 send: SendEventFn,
282 taskType: string,
283 imageUrl?: string
284): Promise<string | null> {
285 try {
287
288 let parts: any[] = [{ text: prompt }];
289 if (imageUrl) {
290 const { data: imageBase64, mimeType } = await imageToBase64(imageUrl);
291 parts.push({
292 inline_data: {
293 mime_type: mimeType,
294 data: imageBase64
295 }
296 });
338}
339
340async function generateImage(prompt: string, send: SendEventFn): Promise<void> {
341 let cleanPrompt = prompt;
342 if (cleanPrompt.endsWith('--image')) {
343 cleanPrompt = cleanPrompt.substring(0, cleanPrompt.length - 7).trim();
344 }
345
346 const imagePrompt = `Detailed ${cleanPrompt}`;
347 send("text", { text: `๐ŸŽจ Generating image...` });
348
349 const result = await callPoeModelParallel(
350 POE_MODELS.imageGeneration,
351 imagePrompt,
352 send,
353 "Image Generation",
354 15000,
355 true
358 if (!result) {
359 send("error", {
360 text: `โŒ Image generation failed: All models exhausted.`,
361 allow_retry: true
362 });
436}
437
438async function analyzeImage(imageUrl: string, userPrompt: string, send: SendEventFn): Promise<void> {
439 let analysisPrompt: string;
440 if (!userPrompt || userPrompt.trim().length === 0) {
441 analysisPrompt = `Analyze this image in detail. Provide a comprehensive analysis including what you see, colors, objects, people, text, context, and any other relevant details.`;
442 } else {
443 analysisPrompt = `${userPrompt}`;
444 }
445
446 send("text", { text: `๐Ÿ” Analyzing image...` });
447
448 // Try Gemini Pro with vision first
449 const geminiResult = await callGeminiApi(GEMINI_VISION_CONFIG, analysisPrompt, send, "Image Analysis", imageUrl);
450 if (geminiResult) return;
451
452 // Fallback to Poe models with URL reference
453 const fallbackPrompt = `Analyze image: ${imageUrl}\n\nUser's request: ${userPrompt || "Provide detailed analysis"}`;
454 const poeResult = await callPoeModelParallel(
455 POE_MODELS.imageAnalysis,
456 fallbackPrompt,
457 send,
458 "Image Analysis",
459 15000
460 );
462 if (!poeResult) {
463 send("error", {
464 text: `โŒ Image analysis failed: All models exhausted.`,
465 allow_retry: true
466 });
509 }
510
511 if (cleanContent.endsWith('--image')) {
512 return { intent: 'image_generation', useClaudeModels };
513 }
514
518
519 if (hasAttachments) {
520 if (lowerContent.includes('image') || lowerContent.includes('picture') ||
521 lowerContent.includes('photo') || lowerContent.includes('analyze') ||
522 lowerContent.includes('what') || lowerContent.includes('describe')) {
523 return { intent: 'image_analysis', useClaudeModels };
524 }
525 return { intent: 'file_analysis', useClaudeModels };
526 }
527
528 if (lowerContent.includes('generate image') || lowerContent.includes('create image') ||
529 lowerContent.includes('draw') || lowerContent.includes('picture of') ||
530 lowerContent.includes('image of')) {
531 return { intent: 'image_generation', useClaudeModels };
532 }
533
563 try {
564 switch (intent) {
565 case 'image_generation':
566 await generateImage(userContent, send);
567 break;
568
590 break;
591
592 case 'image_analysis':
593 if (attachments.length > 0) {
594 const imageAttachment = attachments.find(att =>
595 att.content_type && att.content_type.startsWith('image/')
596 );
597 if (imageAttachment && imageAttachment.url) {
598 await analyzeImage(imageAttachment.url, userContent, send);
599 } else {
600 send("error", {
605 } else {
606 send("error", {
607 text: "Please attach an image for analysis.",
608 allow_retry: false,
609 });
652 const rateCard = "| Task Type | Price |\n" +
653 "|-----------|-------|\n" +
654 `| Input (image) | ${IMAGE_COST} points/message |\n` +
655 `| Input (file) | ${FILE_ANALYSIS_COST} points/message |\n` +
656 `| Input (text) | ${TEXT_COST} points/message |\n` +
657 `| Output (search) | ${SEARCH_COST} points/message |\n` +
658 `| Output (image) | ${IMAGE_COST} points/message |\n`;
659
660 return {
Gemini-Nano-Banana-03

Gemini-Nano-Banana-031 file match

@aibotcommanderโ€ขUpdated 46 mins ago
Generate beautifull images: https://poe.com/Gemini-Nano-Banana
Gemini-Nano-Banana-01

Gemini-Nano-Banana-011 file match

@aibotcommanderโ€ขUpdated 50 mins ago
Generate beautifull images: https://poe.com/Gemini-Nano-Banana
Chrimage
Atiq
"Focal Lens with Atig Wazir" "Welcome to my photography journey! I'm Atiq Wazir, a passionate photographer capturing life's beauty one frame at a time. Explore my gallery for stunning images, behind-the-scenes stories, and tips & tricks to enhance your own