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%20%22Optional%20title%22?q=image&page=4&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 6398 results for "image"(900ms)

TownieuseChatLogic.ts4 matches

@charmaine•Updated 7 hours ago
9 bearerToken: string;
10 selectedFiles: string[];
11 images: (string | null)[];
12 soundEnabled: boolean;
13}
19 bearerToken,
20 selectedFiles,
21 images,
22 soundEnabled,
23}: UseChatLogicProps) {
43 anthropicApiKey,
44 selectedFiles,
45 images: images
46 .filter((img): img is string => {
47 const isValid = typeof img === "string" && img.startsWith("data:");
48 if (!isValid && img !== null) {
49 console.warn("Invalid image format:", img?.substring(0, 50) + "...");
50 }
51 return isValid;

Townieusage-dashboard.ts5 matches

@charmaine•Updated 7 hours ago
74 SUM(cache_write_tokens) as total_cache_write_tokens,
75 SUM(price) as total_price,
76 SUM(num_images) as total_images
77 FROM ${USAGE_TABLE}
78 WHERE our_api_token = 1
207 <th>Cache Write</th>
208 <th>Total Price</th>
209 <th>Images</th>
210 </tr>
211 </thead>
222 <td>${formatNumber(row.total_cache_write_tokens)}</td>
223 <td class="price">${formatPrice(row.total_price)}</td>
224 <td>${formatNumber(row.total_images)}</td>
225 </tr>
226 `).join("")
255 <th>Price</th>
256 <th>Finish</th>
257 <th>Images</th>
258 <th>Our API</th>
259 </tr>
275 <td class="price">${formatPrice(row.price)}</td>
276 <td>${row.finish_reason}</td>
277 <td>${formatNumber(row.num_images)}</td>
278 <td>${formatBoolean(row.our_api_token)}</td>
279 </tr>

TownieTODOs.md2 matches

@charmaine•Updated 7 hours ago
29 - [x] File write as a code embed
30 - [x] str_replace as a diff view
31- [x] make image drop area invisible and bigger
32- [x] Give it all the code (except maybe .txt files) as initial context (like cursor sonnet max)
33- [x] I seem to have lost the delete file tool and instructions, try to find them back in history or re-create?
55- [x] Create branch
56- [x] URL input + pathname
57- [x] Image upload controls
58- [x] Preview refresh button
59- [x] Audio controls

Towniesystem_prompt.txt2 matches

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

Towniestyles.css11 matches

@charmaine•Updated 7 hours ago
682 background-color: var(--highlight);
683}
684.card-image {
685 display: flex;
686 align-items: center;
704}
705
706.image-placeholder,
707.image-thumbnail {
708 width: 40px;
709 height: 40px;
711 object-fit: cover;
712}
713.image-placeholder {
714 background-color: var(--muted);
715}
722}
723
724.image-row {
725 display: flex;
726 gap: var(--space-1);
727}
728.input-image {
729 position: relative;
730 border: 1px solid var(--muted);
731 border-radius: 6px;
732}
733.remove-image-button {
734 position: absolute;
735 top: 0;
744 opacity: 0;
745}
746.input-image:hover .remove-image-button {
747 opacity: 1;
748}
749
750.image-drop-overlay {
751 position: fixed;
752 top: 0;
761 justify-content: center;
762}
763.image-drop-inner {
764 padding: var(--space-2);
765 background-color: var(--background);
766}
767
768.transition, .input-box, .icon-button, .button, .remove-image-button {
769 transition-property: color, background-color, border-color, opacity;
770 transition-duration: 200ms;

Towniesend-message.ts12 matches

@charmaine•Updated 7 hours ago
20 }
21
22 const { messages, project, branchId, anthropicApiKey, selectedFiles, images } = await c.req.json();
23 // console.log("Original messages:", JSON.stringify(messages, null, 2));
24 // console.log("Images received:", JSON.stringify(images, null, 2));
25
26 const apiKey = anthropicApiKey || Deno.env.get("ANTHROPIC_API_KEY");
39 let coreMessages = convertToCoreMessages(messages);
40
41 // If there are images, we need to add them to the last user message
42 if (images && Array.isArray(images) && images.length > 0) {
43 // Find the last user message
44 const lastUserMessageIndex = coreMessages.findIndex(
62 };
63
64 // Add each image to the content array using the correct ImagePart format
65 for (const image of images) {
66 if (image && image.url) {
67 // Extract mime type from data URL if available
68 let mimeType = undefined;
69 if (image.url.startsWith("data:")) {
70 const matches = image.url.match(/^data:([^;]+);/);
71 if (matches && matches.length > 1) {
72 mimeType = matches[1];
75
76 newUserMessage.content.push({
77 type: "image",
78 image: image.url,
79 mimeType,
80 });
163 branch_id: branchId,
164 val_id: project.id,
165 num_images: images?.length || 0,
166 model,
167 finish_reason: result.finishReason,

Townieschema.tsx2 matches

@charmaine•Updated 7 hours ago
16 price: number;
17 finish_reason: string;
18 num_images: number;
19 our_api_token: boolean;
20}
36 price REAL,
37 finish_reason TEXT,
38 num_images INTEGER,
39 our_api_token INTEGER NOT NULL
40 )

Towniequeries.tsx4 matches

@charmaine•Updated 7 hours ago
54 model,
55 finish_reason,
56 num_images,
57 our_api_token,
58}: {
66 model: string;
67 finish_reason: string;
68 num_images: number;
69 our_api_token: boolean;
70}) {
90 price,
91 finish_reason,
92 num_images,
93 our_api_token
94 ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
107 price,
108 finish_reason,
109 num_images,
110 our_api_token ? 1 : 0,
111 ],

TownieProjectsRoute.tsx7 matches

@charmaine•Updated 7 hours ago
48 user: {
49 username: string;
50 profileImageUrl: string|null;
51 };
52 project: any;
55 <div className="card">
56
57 {project.imageUrl ? (
58 <img src={project.imageUrl} className="card-image" />
59 ) : user.profileImageUrl ? (
60 <div className="card-image">
61 <img
62 src={user.profileImageUrl}
63 width="48"
64 height="48"
67 </div>
68 ) : (
69 <div className="card-image placeholder" />
70 )}
71 <div className="card-body">

TownieInputBox.tsx46 matches

@charmaine•Updated 7 hours ago
2import { useRef, useState, useEffect } from "https://esm.sh/react@18.2.0?dev";
3import { PlusIcon, ArrowUpIcon, Square, XIcon } from "./icons.tsx";
4import { processFiles } from "../utils/images.ts";
5
6export function InputBox ({
11 running,
12 error,
13 images,
14 setImages,
15} : {
16 value: string;
20 running: boolean;
21 error: any;
22 images: (string|null)[];
23 setImages: (images: (string|null)[]) => void;
24}) {
25 const form = useRef(null);
57 autoFocus={true}
58 />
59 <ImageRow images={images} setImages={setImages} />
60 <div className="toolbar">
61 <UploadButton
62 disabled={running}
63 images={images}
64 setImages={setImages}
65 />
66 <div className="spacer" />
88}
89
90export function ImageDropContainer ({
91 images,
92 setImages,
93 running,
94 children,
95}: {
96 images: (string|null)[];
97 setImages: (images: (string|null)[]) => void;
98 running: boolean;
99 children: React.ReactNode;
100}) {
101 const dragging = useImageDrop({ images, setImages, running });
102
103 return (
105 {children}
106 {dragging && (
107 <div className="image-drop-overlay">
108 <div className="image-drop-inner">
109 Drop images here to upload
110 </div>
111 </div>
115}
116
117export function useImageDrop ({ images, setImages, running }: {
118 images: (string|null)[];
119 setImages(images: (string|null)[]) => void;
120 running: boolean;
121}) {
143 setDragging(false);
144 if (e.dataTransfer?.files && !running) {
145 processFiles(Array.from(e.dataTransfer.files), images, setImages);
146 }
147 }
164}
165
166function ImageRow ({ images, setImages }: {
167 images: (string|null)[];
168 setImages: (images: (string|null)[]) => void;
169}) {
170 return (
171 <div className="image-row">
172 {images.map((image, i) => (
173 <Thumbnail
174 key={i}
175 image={image}
176 onRemove={() => {
177 setImages([
178 ...images.slice(0, i),
179 ...images.slice(i + 1),
180 ]);
181 }}
186}
187
188function Thumbnail ({ image, onRemove }: {
189 image: string|null;
190 onRemove: () => void;
191}) {
192 if (!image) return null;
193
194 return (
195 <div className="input-image">
196 <img
197 src={image}
198 alt="User uploaded image"
199 className="image-thumbnail"
200 />
201 <button
202 type="button"
203 title="Remove image"
204 className="remove-image-button"
205 onClick={onRemove}
206 >
212
213function UploadButton ({
214 images,
215 setImages,
216 disabled,
217}: {
218 images: (string|null)[];
219 setImages: (images: (string|null)[]) => void;
220 disabled: boolean;
221}) {
226 <button
227 type="button"
228 title="Upload image"
229 disabled={disabled}
230 onClick={e => {
234 <PlusIcon />
235 <div className="sr-only">
236 Upload image
237 </div>
238 </button>
243 onChange={e => {
244 if (e.target.files) {
245 processFiles(Array.from(e.target.files), images, setImages);
246 }
247 }}

image-inpainting1 file match

@themichaellai•Updated 1 day ago

brainrot_image_gen1 file match

@dcm31•Updated 1 week ago
Generate images for Italian Brainrot characters using FAL AI
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