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/image-url.jpg?q=image&page=594&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 6549 results for "image"(805ms)

websimmain.tsx15 matches

@cofsanaUpdated 10 months ago
1import urlHeader from "https://esm.town/v/substrate/urlHeader";
2import { ComputeText, GenerateImage, sb, Substrate, UpscaleImage } from "npm:substrate";
3
4const substrate = new Substrate({ apiKey: Deno.env.get("SUBSTRATE_API_KEY") });
7 const url = new URL(req.url);
8 const searchParams = url.searchParams;
9 const simImage = searchParams.get("image");
10 if (simImage) {
11 const prompt = new ComputeText({
12 prompt: sb
13 .interpolate`Describe an image named ${simImage}. Describe a single subject with background and style details.
14 We'll use this description to generate an image so include creative details like style, vibe, mood, character.`,
15 temperature: 0.8,
16 });
17 prompt.cache_age = 60 * 60;
18 const image = new GenerateImage({
19 prompt: prompt.future.text,
20 });
21 image.cache_age = 60 * 60 * 24;
22 const res = await substrate.run(image);
23 const imageUri = res.get(image).image_uri;
24 const base64Data = imageUri.split(",")[1];
25 const imageData = Uint8Array.from(atob(base64Data), c => c.charCodeAt(0));
26 return new Response(imageData, {
27 headers: {
28 "Content-Type": "image/jpeg",
29 },
30 });
39 }
40
41 const instructions = `all images should be in the form /?image=<image description including art style>.
42 always use descriptive image names including the particular style (e.g. photograph, illustration).
43 include plenty of local urls to other pages on the same domain.
44 all urls must be in this format: /?url=<full url with a domain, descriptive path, and params>.

sqlite_adminREADME.md1 match

@johnsmithUpdated 10 months ago
3This is a lightweight SQLite Admin interface to view and debug your SQLite data.
4
5![Screenshot 2023-12-08 at 13.35.04.gif](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/ee9a9237-96a0-4276-60b5-aa8c56e49800/public)
6
7It's currently super limited (no pagination, editing data, data-type specific viewers), and is just a couple dozens lines of code over a couple different vals. Forks encouraged! Just comment on the val if you add any features that you want to share.

sqliteExplorerAppREADME.md1 match

@willthereaderUpdated 10 months ago
3View and interact with your Val Town SQLite data. It's based off Steve's excellent [SQLite Admin](https://www.val.town/v/stevekrouse/sqlite_admin?v=46) val, adding the ability to run SQLite queries directly in the interface. This new version has a revised UI and that's heavily inspired by [LibSQL Studio](https://github.com/invisal/libsql-studio) by [invisal](https://github.com/invisal). This is now more an SPA, with tables, queries and results showing up on the same page.
4
5![image.webp](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/c8e102fd-39ca-4bfb-372a-8d36daf43900/public)
6
7## Install

statusREADME.md1 match

@pomdtrUpdated 10 months ago
4
5<div align="center">
6<img src="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/67a1d35e-c37c-41a4-0e5a-03a9ba585d00/public" width="700px"/>
7</div>

uptimeREADME.md1 match

@pomdtrUpdated 10 months ago
10
11<div align="center">
12<img src="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/67a1d35e-c37c-41a4-0e5a-03a9ba585d00/public" width="500px"/>
13</div>

generateQRmain.tsx2 matches

@neverstewUpdated 10 months ago
13 );
14 }
15 const base64Image = await qrcode(url.toString(), { type: "text/html" });
16 return new Response(
17 `<html>
20 </head>
21 <body>
22 <img src=${base64Image} style="margin: 0 auto; max-width: 600px" width="100%" />
23 <p style="font-size: 0.85rem">QR Code generated using <a href="https://val.town">val.town</a></p>
24 <p style="font-size: 0.85rem">Built with &#128151; by <a href="https://twitter.com/neverstew">Neverstew</a></p>

getValsContextWindowmain.tsx1 match

@janpaul123Updated 10 months ago
338 ---
339
340 Val Town comes with blob storage built-in. It allows for storing any data: text, JSON, images. You can access it via [\`std/blob\`](https://www.val.town/v/std/blob).
341
342 Blob storage is scoped globally to your account. If you set a blob in one val, you can retrieve it by the same key in another val. It's backed by Cloudflare R2.

templatemain.tsx1 match

@liamUpdated 10 months ago
1import promptHeader from "https://esm.town/v/substrate/promptHeader";
2import wrapper from "https://esm.town/v/substrate/substrateBadgeMiddleware";
3import { ComputeJSON, ComputeText, GenerateImage, sb, Substrate } from "npm:substrate";
4
5async function handler(req: Request): Promise<Response> {

substrateBadgemain.tsx1 match

@substrateUpdated 10 months ago
45 return new Response(badge, {
46 headers: {
47 "Content-Type": "image/svg+xml",
48 },
49 });

IllustratedPrimermain.tsx22 matches

@kousun12Updated 10 months ago
1import wrapper from "https://esm.town/v/substrate/substrateBadgeMiddleware";
2import { ComputeJSON, ComputeText, GenerateImage, sb, Substrate } from "npm:substrate";
3import { z } from "npm:zod";
4import { zodToJsonSchema } from "npm:zod-to-json-schema";
23 });
24 const prompt1 = new ComputeText({
25 prompt: sb.interpolate`generate a description of an image of ${
26 c1.future.json_object.get("concepts").at(0)
27 }. Be concise and terse. Include details on the background, angle & framing, and style.`,
28 });
29 const prompt2 = new ComputeText({
30 prompt: sb.interpolate`generate a description of an image of ${
31 c1.future.json_object.get("concepts").at(1)
32 }. Be concise and terse. Include details on the background, angle & framing, and style.`,
43 ${caption1.future.text}`,
44 }, { cache_age: 800 });
45 const image1 = new GenerateImage({ prompt: prompt1.future.text });
46 const image2 = new GenerateImage({ prompt: prompt2.future.text });
47 const c2 = new ComputeJSON({
48 prompt: sb.interpolate`List deeper concepts or ideas related to: ${c1.future.json_object.get("concepts").at(0)}
53 });
54 const prompt3 = new ComputeText({
55 prompt: sb.interpolate`generate a description of an image of ${
56 c2.future.json_object.get("concepts").at(0)
57 }. Be creative depicting abstract topics with extra detail. Include details on the background, angle & framing, and style.`,
58 });
59 const prompt4 = new ComputeText({
60 prompt: sb.interpolate`generate a description of an image of ${
61 c2.future.json_object.get("concepts").at(1)
62 }. Be creative depicting abstract topics with extra detail. Include details on the background, angle & framing, and style.`,
77 ${caption3.future.text}`,
78 });
79 const image3 = new GenerateImage({ prompt: prompt3.future.text });
80 const image4 = new GenerateImage({ prompt: prompt4.future.text });
81 const nodes = [image1, caption1, image2, caption2, image3, caption3, image4, caption4];
82 const stream = await substrate.stream(...nodes);
83
88 async start(controller) {
89 const pairs = [
90 { image: null, caption: null, title: null },
91 { image: null, caption: null, title: null },
92 { image: null, caption: null, title: null },
93 { image: null, caption: null, title: null },
94 ];
95
96 const outputPair = (pair, index) => {
97 if (pair.image && pair.caption) {
98 controller.enqueue(new TextEncoder().encode(
99 `<div style="display:flex;justify-content:center;align-items:center;margin-bottom:20px;">
100 <div style="margin:0 10px;">${pair.image}</div>
101 <div style="margin:0 10px;font-size:1.2rem;">
102 <a href="/?subject=${pair.title}"><b>${capitalize(pair.title)}</b></a><br/>${pair.caption}</div>
103</div>`,
104 ));
105 pairs[index] = { image: null, caption: null, title: null }; // Reset after output
106 }
107 };
152 if (index !== -1) {
153 const pairIndex = Math.floor(index / 2);
154 const isImage = index % 2 === 0;
155 const content = event.data.image_uri
156 ? `<img src="${event.data.image_uri}" width=400/>`
157 : `<div>${event.data.text}</div>`;
158
159 if (isImage) {
160 pairs[pairIndex].image = content;
161 } else {
162 pairs[pairIndex].caption = content;

image-gen

@armadillomikeUpdated 8 hours ago

gpt-image-test1 file match

@CaptainJackUpdated 1 day ago
测试 gpt image 的不同 api 能否满足图片生成要求
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