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/?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 8850 results for "image"(485ms)

untitled-619main.ts53 matches

@zyloxtubeUpdated 42 mins ago
67 "Client-Type": "pc",
68 "Locale": "en-US",
69 "Referer": "https://www.oreateai.com/home/vertical/aiImage",
70 "User-Agent":
71 "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
106 "Locale": "en-US",
107 "Origin": "https://www.oreateai.com",
108 "Referer": "https://www.oreateai.com/home/vertical/aiImage",
109 "User-Agent":
110 "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
111 },
112 body: JSON.stringify({
113 fr: "GGSEMIMAGE",
114 email,
115 ticketID,
175 "Locale": "en-US",
176 "Origin": "https://www.oreateai.com",
177 "Referer": "https://www.oreateai.com/home/chat/aiImage",
178 "User-Agent":
179 "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
182
183// ==================== استخراج رابط الصورة ====================
184function extractImageUrl(result: string): string | null {
185 if (!result) return null;
186
217
218// ==================== تحويل الصورة إلى فريمات باستخدام PNG.js (بدون مشاكل SSL) ====================
219async function downloadImageAsBuffer(url: string): Promise<Buffer> {
220 console.log("📥 تحميل الصورة...");
221
226 "User-Agent":
227 "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
228 "Accept": "image/webp,image/apng,image/*,*/*;q=0.8",
229 },
230 });
242 console.log("🔄 استخدام Google Viewer كبديل...");
243 const googleViewerUrl =
244 `https://images1-focus-opensocial.googleusercontent.com/gadgets/proxy?url=${
245 encodeURIComponent(url)
246 }&container=focus`;
284}
285
286async function imageToFrames(imageUrl: string) {
287 console.log("🖼️ تحويل الصورة إلى فريمات...");
288
289 try {
290 // تحميل الصورة كـ Buffer
291 const imageBuffer = await downloadImageAsBuffer(imageUrl);
292
293 // محاولة فك تشفير الصورة كـ PNG
294 let png: any;
295 try {
296 png = PNG.sync.read(imageBuffer);
297 } catch (pngError) {
298 console.log("⚠️ الصورة ليست PNG، نحولها...");
299
300 // إذا فشلت، نستخدم خدمة تحويل خارجية
301 const converterUrl = `https://images.weserv.nl/?url=${
302 encodeURIComponent(imageUrl)
303 }&output=png`;
304 const response = await fetch(converterUrl);
365
366// ==================== توليد الصورة وتحويلها إلى فريمات ====================
367async function generateImage(
368 prompt: string,
369 imageSize?: string,
370 style?: string,
371) {
376 }
377
378 if (imageSize) {
379 finalPrompt = `${finalPrompt}\nImage size: ${imageSize}`;
380 }
381
391 method: "POST",
392 headers,
393 body: JSON.stringify({ type: "aiImage", docId: "" }),
394 });
395
412 clientType: "pc",
413 type: "chat",
414 chatType: "aiImage",
415 chatId,
416 focusId: chatId,
433 let buffer = "";
434 let fullResponse = "";
435 let imageUrl: string | null = null;
436
437 console.log(" ⏳ انتظار النتيجة...");
455
456 if (jsonStr.includes("http")) {
457 const extracted = extractImageUrl(jsonStr);
458 if (extracted) {
459 imageUrl = extracted;
460 break;
461 }
466 if (json.data?.result) {
467 console.log("🎨 تم استلام result");
468 const extracted = extractImageUrl(json.data.result);
469 if (extracted) {
470 imageUrl = extracted;
471 break;
472 }
473 }
474
475 if (json.data?.imageUrl) {
476 imageUrl = json.data.imageUrl;
477 break;
478 }
479
480 if (json.data?.url) {
481 imageUrl = json.data.url;
482 break;
483 }
491 }
492
493 if (imageUrl) break;
494 }
495
496 if (!imageUrl) {
497 imageUrl = extractImageUrl(fullResponse);
498 }
499
500 if (imageUrl) {
501 console.log("✅ تم العثور على رابط الصورة:", imageUrl);
502
503 // تحويل الصورة إلى فريمات
504 const frames = await imageToFrames(imageUrl);
505
506 const result: any = {
507 success: true,
508 metadata: {
509 width: imageSize || "unknown",
510 height: imageSize || "unknown",
511 frameCount: frames.length,
512 compression: `كل فريم يمثل 5 بيكسلات`,
524 } else {
525 // إذا فشل التحويل، نضيف رابط الصورة
526 result.imageUrl = imageUrl;
527 result.warning =
528 "تم إرجاع رابط الصورة بدلاً من الفريمات بسبب مشكلة في التحويل";
553 try {
554 const body = await c.req.json();
555 const { prompt, imageSize, style } = body;
556
557 if (!prompt) {
562 }
563
564 const result = await generateImage(prompt, imageSize, style);
565
566 if (result.success) {
581 try {
582 const prompt = c.req.query("prompt");
583 const imageSize = c.req.query("imageSize");
584 const style = c.req.query("style");
585
591 }
592
593 const result = await generateImage(prompt, imageSize, style);
594
595 if (result.success) {
609app.get("/api/generate/stream", async (c) => {
610 const prompt = c.req.query("prompt");
611 const imageSize = c.req.query("imageSize");
612 const style = c.req.query("style");
613
652 method: "POST",
653 headers,
654 body: JSON.stringify({ type: "aiImage", docId: "" }),
655 },
656 );
666 let finalPrompt = prompt;
667 if (style) finalPrompt = `${finalPrompt}, ${style}`;
668 if (imageSize) finalPrompt = `${finalPrompt}\nImage size: ${imageSize}`;
669
670 await stream.writeSSE({
679 clientType: "pc",
680 type: "chat",
681 chatType: "aiImage",
682 chatId,
683 focusId: chatId,
702 const chunk = decoder.decode(value);
703
704 const imageUrl = extractImageUrl(chunk);
705 if (imageUrl) {
706 await stream.writeSSE({
707 data: JSON.stringify({
708 status: "image_received",
709 message: "✅ تم استلام الصورة، جاري تحويلها إلى فريمات...",
710 }),
713
714 // تحويل الصورة إلى فريمات
715 const frames = await imageToFrames(imageUrl);
716
717 const result: any = {
732 } else {
733 result.success = true;
734 result.imageUrl = imageUrl;
735 result.warning = "تم إرجاع رابط الصورة بدلاً من الفريمات";
736 }
757 c.json({
758 status: "online",
759 message: "OreateAI Image Generator API - مع تحويل الصور إلى فريمات",
760 endpoints: {
761 "POST /api/generate": "JSON body: { prompt, imageSize?, style? }",
762 "GET /api/generate": "Query params: ?prompt=...&imageSize=...&style=...",
763 "GET /api/generate/stream": "SSE stream لنفس المعاملات",
764 },
765 example:
766 "GET /api/generate?prompt=قطة%20صغيرة&imageSize=1024x1024&style=realistic",
767 }));
768

x402-playgroundscreenshot.tsx1 match

@stevekrouseUpdated 1 hour ago
67 }
68 const base64 = btoa(binary);
69 const dataUrl = `data:image/png;base64,${base64}`;
70
71 return c.html(

D8README.md1 match

@joyfad06Updated 2 hours ago
3Feel free to mess around with this val and make it your own :). Just click on "Fork" in the top right.
4
5You can change the phrases that show up as you click no, you can change the firstImg and secondImg, maybe even add more images. And you can also change the colors and any of the text on the screen!
6
7Have fun with it and hopefully your crush says yes hehe.

valentineREADME.md1 match

@joyfad06Updated 2 hours ago
3Feel free to mess around with this val and make it your own :). Just click on "Fork" in the top right.
4
5You can change the phrases that show up as you click no, you can change the firstImg and secondImg, maybe even add more images. And you can also change the colors and any of the text on the screen!
6
7Have fun with it and hopefully your crush says yes hehe.

x402-playgroundREADME.md1 match

@stevekrouseUpdated 2 hours ago
64 Buyer->>Browser: Navigate to user's URL
65 Browser-->>Buyer: PNG screenshot
66 Buyer-->>User: Return screenshot image
67```
68

untitled-7771main.ts51 matches

@zyloxtubeUpdated 3 hours ago
1// ai-image-complete-v2.ts
2// كود متكامل مع صور بديلة
3
79): Promise<string> {
80 let fullResponse = "";
81 let imageUrl = "";
82
83 while (true) {
99
100 if (data.data?.imgUrl) {
101 imageUrl = data.data.imgUrl;
102 console.log(` ✅ تم العثور على الصورة: ${imageUrl}`);
103 } else if (data.data?.url) {
104 imageUrl = data.data.url;
105 console.log(` ✅ تم العثور على الصورة: ${imageUrl}`);
106 }
107
116 }
117
118 return imageUrl || fullResponse;
119}
120
131 "Client-Type": "pc",
132 "Locale": "en-US",
133 "Referer": "https://www.oreateai.com/home/vertical/aiImage",
134 "User-Agent":
135 "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
167 "Locale": "en-US",
168 "Origin": "https://www.oreateai.com",
169 "Referer": "https://www.oreateai.com/home/vertical/aiImage",
170 "User-Agent":
171 "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
172 },
173 body: JSON.stringify({
174 fr: "GGSEMIMAGE",
175 email,
176 ticketID,
200
201// ==================== دالة رفع الصورة ====================
202async function uploadImageFromUrl(
203 imageUrl: string,
204 cookies: string[],
205 source: string = "aiImage",
206): Promise<{ bosUrl: string; fileExt: string; size: number }> {
207 console.log(`🌐 جاري تحميل الصورة من: ${imageUrl}`);
208
209 // إضافة headers لتجنب 403
210 const imageResponse = await fetch(imageUrl, {
211 headers: {
212 "User-Agent":
213 "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
214 "Accept": "image/webp,image/apng,image/*,*/*;q=0.8",
215 "Accept-Language": "en-US,en;q=0.9",
216 "Referer": "https://www.google.com/",
218 });
219
220 if (!imageResponse.ok) {
221 console.log(`⚠️ فشل تحميل الصورة من الرابط: ${imageResponse.status}`);
222 console.log("📥 جاري استخدام صورة افتراضية...");
223
224 // استخدام صورة افتراضية من Unsplash (مجانية)
225 const fallbackUrl =
226 "https://images.unsplash.com/photo-1547425260-76bcadfb4f2c?w=400";
227 const fallbackResponse = await fetch(fallbackUrl, {
228 headers: {
250 }
251
252 const imageArrayBuffer = await imageResponse.arrayBuffer();
253 const imageBytes = new Uint8Array(imageArrayBuffer);
254
255 // استخراج معلومات الملف من الرابط
256 const urlParts = imageUrl.split("/");
257 const fullFileName = urlParts[urlParts.length - 1].split("?")[0];
258 let fileExt = fullFileName.split(".").pop() || "jpg";
259 if (fileExt.includes("_")) fileExt = "jpg";
260
261 const fileName = fullFileName.replace(`.${fileExt}`, "") || "image";
262 const fileSize = imageArrayBuffer.byteLength;
263
264 return await performUpload(
265 imageBytes,
266 fileName,
267 fileExt,
274// دالة مساعدة للرفع
275async function performUpload(
276 imageBytes: Uint8Array,
277 fileName: string,
278 fileExt: string,
301 "Cookie": cookieString,
302 "Origin": "https://www.oreateai.com",
303 "Referer": "https://www.oreateai.com/home/chat/aiImage",
304 "User-Agent":
305 "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.3 Mobile/15E148 Safari/604.1",
346 method: "PUT",
347 headers: {
348 "Content-Type": `image/${fileExt === "jpg" ? "jpeg" : fileExt}`,
349 "x-goog-session-key": sessionkey,
350 "x-goog-content-length-range": `0,${fileSize}`,
351 "Content-Length": fileSize.toString(),
352 },
353 body: imageBytes,
354 },
355 );
366
367// ==================== دالة تعديل الصورة ====================
368async function editImage(
369 bosUrl: string,
370 fileExt: string,
380 "Locale": "en-US",
381 "Origin": "https://www.oreateai.com",
382 "Referer": "https://www.oreateai.com/home/chat/aiImage",
383 "User-Agent":
384 "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.3 Mobile/15E148 Safari/604.1",
392 headers: genHeaders,
393 body: JSON.stringify({
394 type: "aiImage",
395 docId: "",
396 }),
425 clientType: "wap",
426 type: "chat",
427 chatType: "aiImage",
428 chatTitle: "Unnamed Session",
429 focusId: newChatId,
435 attachments: [{
436 bos_url: bosUrl,
437 doc_title: "image",
438 doc_type: fileExt,
439 size: fileSize,
472try {
473 // قائمة صور بديلة (كلها مجانية)
474 const imageUrls = [
475 "https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=400", // رجل سعيد
476 "https://images.unsplash.com/photo-1531427186627-4fd839c4d25c?w=400", // رجل آخر
477 "https://images.pexels.com/photos/614810/pexels-photo-614810.jpeg?auto=compress&cs=tinysrgb&w=400", // رجل
478 "https://images.pexels.com/photos/220453/pexels-photo-220453.jpeg?auto=compress&cs=tinysrgb&w=400", // رجل سعيد
479 ];
480
481 // اختيار صورة عشوائية
482 const sourceImageUrl =
483 imageUrls[Math.floor(Math.random() * imageUrls.length)];
484
485 console.log("📋 [1/3] إنشاء حساب جديد...");
488
489 console.log("📋 [2/3] رفع الصورة...");
490 console.log(`🖼️ الصورة المختارة: ${sourceImageUrl}`);
491 const { bosUrl, fileExt, size } = await uploadImageFromUrl(
492 sourceImageUrl,
493 cookies,
494 );
497
498 console.log("📋 [3/3] تعديل الصورة...");
499 const result = await editImage(bosUrl, fileExt, size, cookies, email);
500
501 console.log("\n" + "=".repeat(60));
508 // تحميل الصورة
509 console.log("\n📥 جاري تحميل الصورة...");
510 const imageRes = await fetch(result);
511 if (imageRes.ok) {
512 const imageBlob = await imageRes.blob();
513 const fileName = `final_image_${Date.now()}.${fileExt}`;
514 await Deno.writeFile(
515 fileName,
516 new Uint8Array(await imageBlob.arrayBuffer()),
517 );
518 console.log(`✅ تم حفظ الصورة في: ${fileName}`);
526}
527
528// للتشغيل: deno run --allow-net --allow-write ai-image-complete-v2.ts

untitled-8349main.ts21 matches

@zyloxtubeUpdated 4 hours ago
85 "Client-Type": "pc",
86 "Locale": "en-US",
87 "Referer": "https://www.oreateai.com/home/vertical/aiImage",
88 "User-Agent":
89 "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
121 "Locale": "en-US",
122 "Origin": "https://www.oreateai.com",
123 "Referer": "https://www.oreateai.com/home/vertical/aiImage",
124 "User-Agent":
125 "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
126 },
127 body: JSON.stringify({
128 fr: "GGSEMIMAGE",
129 email,
130 ticketID,
154
155// ==================== دالة رفع الصورة ====================
156async function uploadImageFromUrl(
157 imageUrl: string,
158 cookies: string[],
159 source: string = "aiImage",
160): Promise<string> {
161 console.log(`🌐 جاري تحميل الصورة من: ${imageUrl}`);
162
163 // 1. تحميل الصورة
164 const imageResponse = await fetch(imageUrl);
165 if (!imageResponse.ok) {
166 throw new Error(`فشل تحميل الصورة: ${imageResponse.status}`);
167 }
168
169 const imageArrayBuffer = await imageResponse.arrayBuffer();
170 const imageBytes = new Uint8Array(imageArrayBuffer);
171
172 // استخراج معلومات الملف من الرابط
173 const urlParts = imageUrl.split("/");
174 const fullFileName = urlParts[urlParts.length - 1].split("?")[0];
175 const fileExt = fullFileName.split(".").pop() || "png";
176 const fileName = fullFileName.replace(`.${fileExt}`, "") || "image";
177 const fileSize = imageArrayBuffer.byteLength;
178
179 console.log(
198 "Cookie": cookieString, // ← الكوكيز هنا!
199 "Origin": "https://www.oreateai.com",
200 "Referer": "https://www.oreateai.com/home/chat/aiImage",
201 "User-Agent":
202 "Mozilla/5.0 (iPhone; CPU iPhone OS 18_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.3 Mobile/15E148 Safari/604.1",
243 method: "PUT",
244 headers: {
245 "Content-Type": `image/${fileExt === "jpg" ? "jpeg" : fileExt}`,
246 "x-goog-session-key": sessionkey,
247 },
248 body: imageBytes,
249 },
250 );
266
267 console.log("📋 [2/2] رفع الصورة...");
268 const imageUrl =
269 "https://www.kindpng.com/picc/m/87-873966_transparent-man-happy-black-man-png-png-download.png";
270
271 const bosUrl = await uploadImageFromUrl(imageUrl, finalCookies);
272
273 console.log("\n" + "=".repeat(60));
279 {
280 bos_url: bosUrl,
281 doc_title: "image",
282 doc_type: bosUrl.split(".").pop(),
283 size: "?",

mdsitecontent.md1 match

@dcm31Updated 5 hours ago
1<img
2src="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/9324cf00-39e6-47dd-995a-da70635f6400/public"
3width="250px" style="border-radius: 10px" />
4

mdsitemain.tsx6 matches

@dcm31Updated 5 hours ago
89});
90
91app.get("/images.zip", async (c) => {
92 const images = [
93 "235f72fc-1f56-436e-f1c0-160159b5c900",
94 "7649601c-951d-4a1b-8e48-6a40a9615900",
104 ];
105 const zip = new JSZip();
106 await Promise.all(images.map(async (id, i) => {
107 const res = await fetch(`https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/${id}/public`);
108 if (!res.ok) return;
109 const buf = await res.arrayBuffer();
110 const ct = res.headers.get("content-type") ?? "";
111 const ext = ct.includes("png") ? "png" : ct.includes("webp") ? "webp" : "jpg";
112 zip.file(`image-${String(i + 1).padStart(2, "0")}.${ext}`, buf);
113 }));
114 const zipBuf = await zip.generateAsync({ type: "uint8array" });
116 headers: {
117 "Content-Type": "application/zip",
118 "Content-Disposition": 'attachment; filename="blog-images.zip"',
119 },
120 });

mdsiteburpees-system.md11 matches

@dcm31Updated 5 hours ago
1![Apple Watch face showing the burpee goal (22) as a complication, alongside a Fatebook prediction "YOGA? (80%)"](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/235f72fc-1f56-436e-f1c0-160159b5c900/public)
2
3![Atom Matrix held in hand, 5x5 LED grid showing the goal number in red](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/7649601c-951d-4a1b-8e48-6a40a9615900/public)
4
5![Fatebook calibration chart — your forecast accuracy vs perfect calibration](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/a5066a9b-a321-4355-d632-4813509bca00/public)
6
7![Fatebook questions list showing "Will I complete N burpees on DATE?" with YES/NO resolutions and model-predicted probabilities](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/da9d6b8a-b53a-46fa-bb46-baa936005800/public)
8
9![Beeminder cumulative burpee goals chart with yellow brick road and green datapoints](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/c972fd2f-9d72-4758-0a09-b4fce04e7800/public)
10
11![Telegram message: "Today's burpee goal: 22 💪" sent at 7:00 AM](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/2cdcc358-300a-4b3b-3267-ea159c38d500/public)
12
13![Burpees val web UI showing goal 22 for Sat 2026-03-07, 28.4% predicted success, EV 6.26](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/7e3a562d-43aa-4e38-3fe4-e90e2c555f00/public)
14
15![Atom Matrix simulator showing the goal number in green LEDs — done state — with 5-dot streak history on the bottom row](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/c9308bf2-7156-4277-da3b-254b2674bc00/public)
16
17![Atom Matrix simulator showing the goal number in red LEDs — not yet done — with streak dots on the bottom row](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/3bb8ed2d-fd7b-4b6a-f293-87d6456b1b00/public)
18
19![Atom Matrix held in hand, 5x5 LED grid glowing red](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/fd9056db-aa2e-46d2-741f-b34d346ff600/public)
20
21![Telegram message: "Today's burpee goal: 22 💪" sent at 7:00 AM](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/b5161be8-e94e-45a5-0fce-39dc6f875000/public)
22
23# My adaptive burpee goal system
Group-Chat

Group-Chat

@aibotcommanderUpdated 1 day ago
https://poe.com/Image-Photo

ocr-vision10 file matches

@arfanUpdated 3 days ago
Upload images/PDFs and extract text using multiple OCR providers