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=461&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 6499 results for "image"(2644ms)

textToImagePlaygroundmain.tsx9 matches

@AIWBβ€’Updated 3 months ago
8 <meta charset="UTF-8">
9 <meta name="viewport" content="width=device-width, initial-scale=1.0">
10 <title>Image Generator</title>
11 <style>
12 ${formStyles}
15<body>
16 <header>
17 <h2>Text to Image Playground</h2>
18 <a target="blank" href="https://fal.ai">fal.ai</a>
19 </header>
24 </select> -->
25
26 <form id="imageForm">
27 <label for="model">Model:</label>
28 <select id="model" name="model">
39 </div>
40 <div class="buttons">
41 <button type="submit">Generate Image</button>
42 <button type="button" id="resetButton">Reset</button>
43 </div>
62 const type = this.value;
63 if (type === 'regular') {
64 document.getElementById('imageForm').style.display = 'block';
65 document.getElementById('realtimeForm').style.display = 'none';
66 } else {
67 document.getElementById('imageForm').style.display = 'none';
68 document.getElementById('realtimeForm').style.display = 'block';
69 }
73 window.addEventListener('DOMContentLoaded', (event) => {
74 document.getElementById('generationType').value = 'regular';
75 document.getElementById('imageForm').style.display = 'block';
76 document.getElementById('realtimeForm').style.display = 'none';
77 });
89 status: 200,
90 });
91 } else if (req.method === 'POST' && url.pathname === '/generate-image') {
92 return await falProxyRequest(req, {
93 baseUrl: 'https://fal.ai/api/fast/image-generation'
94 // apiKey: 'your-fal-api-key' // You might want to use Deno.env.get() for this
95 });

cerebras_codermain.tsx1 match

@Bne44β€’Updated 3 months ago
1165 <meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1166 <meta property="og:type" content="website">
1167 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
1168
1169

codemirrorTsREADME.md1 match

@maxmβ€’Updated 3 months ago
2
3
4![image.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/4534f57c-96cc-4eba-bc51-5b3b52e78500/public)
5
6

OpenAIREADME.md5 matches

@Yogareddy107β€’Updated 3 months ago
23```
24
25## Images
26
27To send an image to ChatGPT, the easiest way is by converting it to a
28data URL, which is easiest to do with [@stevekrouse/fileToDataURL](https://www.val.town/v/stevekrouse/fileToDataURL).
29
30```ts title="Image Example" val
31import { fileToDataURL } from "https://esm.town/v/stevekrouse/fileToDataURL";
32
44 role: "user",
45 content: [{
46 type: "image_url",
47 image_url: {
48 url: dataURL,
49 },

linkinbio_25_2_5main.tsx2 matches

@aazadβ€’Updated 3 months ago
8 name: "Alex Rivera",
9 bio: "Designer & Developer exploring digital minimalism",
10 profileImage: "bi-person-circle", // Bootstrap icon
11 links: [
12 { title: "Portfolio", url: "#", icon: "bi-grid-3x3-gap" },
49 alignItems: 'center'
50 }}>
51 <i className={`bi ${profileData.profileImage}`}></i>
52 </div>
53 <h1 style={{

instamain.tsx25 matches

@aazadβ€’Updated 3 months ago
6 const [user, setUser] = useState(null);
7 const [posts, setPosts] = useState([]);
8 const [selectedImage, setSelectedImage] = useState(null);
9 const [imagePreview, setImagePreview] = useState(null);
10 const [postCaption, setPostCaption] = useState("");
11
20 }, []);
21
22 const handleImageUpload = (e) => {
23 const file = e.target.files[0];
24 if (file) {
25 setSelectedImage(file);
26 const reader = new FileReader();
27 reader.onloadend = () => {
28 setImagePreview(reader.result);
29 };
30 reader.readAsDataURL(file);
35 e.preventDefault();
36 const formData = new FormData();
37 formData.append("image", selectedImage);
38 formData.append("caption", postCaption);
39
46
47 // Reset form
48 setSelectedImage(null);
49 setImagePreview(null);
50 setPostCaption("");
51 };
89 <input
90 type="file"
91 accept="image/*"
92 onChange={handleImageUpload}
93 />
94 {imagePreview && (
95 <img
96 src={imagePreview}
97 alt="Preview"
98 className="image-preview"
99 />
100 )}
104 placeholder="Write a caption..."
105 />
106 <button type="submit" disabled={!selectedImage}>
107 Post
108 </button>
114 <div key={post.id} className="photo-card">
115 <img
116 src={post.image_url}
117 alt={post.caption || "Post"}
118 />
185 id INTEGER PRIMARY KEY AUTOINCREMENT,
186 user_id INTEGER NOT NULL,
187 image_url TEXT NOT NULL,
188 caption TEXT,
189 likes INTEGER DEFAULT 0,
195 const url = new URL(request.url);
196
197 // Image upload handling
198 if (url.pathname === "/api/posts" && request.method === "POST") {
199 const formData = await request.formData();
200 const imageFile = formData.get("image");
201 const caption = formData.get("caption");
202
203 // Store image in blob storage
204 const imageKey = `${KEY}_post_${Date.now()}`;
205 const imageUrl = await blob.set(imageKey, imageFile);
206
207 // Insert post record
208 const result = await sqlite.execute(
209 `INSERT INTO ${KEY}_posts (user_id, image_url, caption) VALUES (1, ?, ?)`,
210 [imageUrl, caption],
211 );
212
213 return Response.json({
214 id: result.lastInsertRowid,
215 image_url: imageUrl,
216 caption,
217 author: "User",
308}
309
310.image-preview {
311 max-width: 100%;
312 max-height: 300px;

emailToDiscordemailHandler5 matches

@wiltβ€’Updated 3 months ago
3import { sendWithRateLimit } from "https://esm.town/v/wilt/emailToDiscord/discordClient";
4import { requestAsObject } from "https://esm.town/v/wilt/serializeRequest";
5import { imageSize } from "npm:image-size";
6
7export interface IEmailHandlerProps {
30}
31
32interface IImage {
33 url: string;
34 height?: number;
41 url?: string;
42 footer?: { text: string };
43 image?: IImage;
44 video?: IImage;
45 provider?: { name?: string; url?: string };
46}
125
126 const fileHooks: RequestInit[] = await Promise.all(sizedAttachments.map(async (file) => {
127 const embed: IEmbed = { image: { url: "attachment://" + file.name } };
128 const boundary = "--boundary";
129 const buf = await file.arrayBuffer();

adroitIvoryEchidnamain.tsx5 matches

@hashamqureshiβ€’Updated 3 months ago
33interface Recommendation {
34 description: string;
35 imageUrl: string;
36 latitude: number;
37 longitude: number;
350 >
351 <img
352 src={rec.imageUrl}
353 alt={`Destination ${index + 1}`}
354 style={{
482 }
483
484 const recommendationsWithImages = await Promise.all(
485 parsedRecommendations.map(async (rec: any) => ({
486 ...rec,
487 imageUrl: `https://maxm-imggenurl.web.val.run/${encodeURIComponent(rec.description)}`
488 }))
489 );
490
491 return new Response(JSON.stringify({
492 recommendations: recommendationsWithImages
493 }), {
494 headers: { 'Content-Type': 'application/json' }

cerebras_codermain.tsx1 match

@Reddysumanthβ€’Updated 3 months ago
1165 <meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1166 <meta property="og:type" content="website">
1167 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
1168
1169

cerebras_codermain.tsx1 match

@Chandu1998β€’Updated 3 months ago
1165 <meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1166 <meta property="og:type" content="website">
1167 <meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
1168
1169

gpt-image-test1 file match

@CaptainJackβ€’Updated 14 hours ago
ζ΅‹θ―• gpt image ηš„δΈεŒ api θƒ½ε¦ζ»‘θΆ³ε›Ύη‰‡η”Ÿζˆθ¦ζ±‚

image-inpainting1 file match

@themichaellaiβ€’Updated 3 days ago
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