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=548&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 12680 results for "image"(4228ms)

untitled-1852README.md2 matches

@Gj64•Updated 4 months ago
28- **Backend**: TypeScript implementation of LDOC reader and writer classes
29- **Frontend**: Modern web interface for interacting with LDOC containers
30- **Viewer**: Support for viewing text files, images, and binary files
31- **API**: RESTful endpoints for encoding, extracting, and inspecting LDOC files
32
58- API endpoints for handling LDOC operations
59- Frontend interface built with HTML, CSS, and JavaScript
60- File viewer with support for syntax highlighting and image preview
61
62## Credits

NPLLMSearchPage.tsx7 matches

@wolf•Updated 4 months ago
28 body: JSON.stringify({
29 prompt,
30 image_size: "landscape_4_3",
31 num_inference_steps: 4,
32 num_images: 1,
33 enable_safety_checker: true,
34 sync_mode: true
38
39 if (!response.ok) {
40 throw new Error(`Failed to generate image: ${response.statusText}`);
41 }
42
43 const data = await response.json();
44 return data.images[0].url;
45 } catch (error) {
46 console.error('Error generating profile picture:', error);
87 // Use the package name and avatarText as the prompt
88 const prompt = `${pkg.name} ${pkg.avatarText} profile picture`;
89 const imageUrl = await generateProfilePicture(prompt);
90 if (imageUrl) {
91 newProfilePictures[pkg.id] = imageUrl;
92 }
93 });

NPLLMsystem_prompt.txt2 matches

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

NPLLMChatRoute.tsx11 matches

@wolf•Updated 4 months ago
9import { useUsageStats } from "../hooks/useUsageStats.ts";
10import { Messages } from "./Messages.tsx";
11import { InputBox, ImageDropContainer } from "./InputBox.tsx";
12import { PreviewFrame } from "./PreviewFrame.tsx";
13import { BranchSelect } from "./BranchSelect.tsx";
61 refetch: () => void;
62}) {
63 const [images, setImages] = useState<(string | null)[]>([]);
64 const [selectedFiles, setSelectedFiles] = useState<string[]>([]);
65 const { audio } = useContext(AppContext);
79 branchId,
80 selectedFiles,
81 images,
82 soundEnabled: audio,
83 });
99
100 return (
101 <ImageDropContainer running={running} images={images} setImages={setImages}>
102 <div className="chat-container container">
103 <div className="chat-messages">
116 onSubmit={(e) => {
117 handleSubmit(e);
118 setImages([]);
119 }}
120 onCancel={handleStop}
121 running={running}
122 error={error}
123 images={images}
124 setImages={setImages}
125 />
126 </div>
135 className="block-link text-link lockup"
136 >
137 {project.imageUrl ? (
138 <img src={project.imageUrl} className="image-thumbnail" />
139 ) : (
140 <div className="image-placeholder" />
141 )}
142 <div>
159 </div>
160 <pre hidden>{JSON.stringify(messages, null, 2)}</pre>
161 </ImageDropContainer>
162 );
163}

NPLLMChatRouteSingleColumn.tsx15 matches

@wolf•Updated 4 months ago
9import { useUsageStats } from "../hooks/useUsageStats.ts";
10import { Messages } from "./Messages.tsx";
11import { InputBox, ImageDropContainer } from "./InputBox.tsx";
12import { PreviewFrame } from "./PreviewFrame.tsx";
13import { BranchSelect } from "./BranchSelect.tsx";
67 refetch: () => void;
68}) {
69 const [images, setImages] = useState<(string|null)[]>([]);
70 const [selectedFiles, setSelectedFiles] = useState<string[]>([]);
71 const { audio, user } = useContext(AppContext);
85 branchId,
86 selectedFiles,
87 images,
88 soundEnabled: audio,
89 });
109
110 return (
111 <ImageDropContainer
112 running={running}
113 images={images}
114 setImages={setImages}>
115 <div className="single-column-container">
116 <div className="single-sticky-header">
120 rel="norefferer"
121 className="block-link text-link lockup">
122 {project.imageUrl ? (
123 <img src={project.imageUrl} className="image-thumbnail" />
124 ) : user?.profileImageUrl ? (
125 <img
126 src={user.profileImageUrl}
127 className="avatar"
128 alt={user.username}
131 />
132 ) : (
133 <div className="image-placeholder" />
134 )}
135 <div>{project.name}</div>
154 onSubmit={e => {
155 handleSubmit(e);
156 setImages([]);
157 }}
158 onCancel={handleStop}
159 running={running}
160 error={error}
161 images={images}
162 setImages={setImages}
163 />
164 <div className="footer">
173 </div>
174 </div>
175 </ImageDropContainer>
176 );
177}

NPLLMHeader.tsx2 matches

@wolf•Updated 4 months ago
32 <button className="h6">Log out</button>
33 </form>
34 {user?.profileImageUrl && (
35 <img
36 src={user.profileImageUrl}
37 alt={user.username}
38 width="32"

NPLLMInputBox.tsx46 matches

@wolf•Updated 4 months ago
2import { useRef, useState, useEffect } from "react";
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 }}

NPLLMProjectsRoute.tsx7 matches

@wolf•Updated 4 months ago
42 user: {
43 username: string;
44 profileImageUrl: string | null;
45 };
46 project: any;
48 return (
49 <div className="card">
50 {project.imageUrl ? (
51 <img src={project.imageUrl} className="card-image" />
52 ) : user.profileImageUrl ? (
53 <div className="card-image">
54 <img
55 src={user.profileImageUrl}
56 width="48"
57 height="48"
60 </div>
61 ) : (
62 <div className="card-image placeholder" />
63 )}
64 <div className="card-body">

NPLLMuseChatLogic.ts4 matches

@wolf•Updated 4 months ago
7 branchId: string | undefined;
8 selectedFiles: string[];
9 images: (string | null)[];
10 soundEnabled: boolean;
11}
17 // bearerToken,
18 selectedFiles,
19 images,
20 soundEnabled,
21}: UseChatLogicProps) {
40 branchId,
41 selectedFiles,
42 images: images
43 .filter((img): img is string => {
44 const isValid = typeof img === "string" && img.startsWith("data:");
45 if (!isValid && img !== null) {
46 console.warn(
47 "Invalid image format:",
48 img?.substring(0, 50) + "..."
49 );

NPLLMimages.ts12 matches

@wolf•Updated 4 months ago
1
2export const PROMPT_IMAGE_LIMIT = 5;
3
4export const processFiles = async (files: File[], images: (string | null)[], setImages: (images: (string | null)[]) => void) => {
5 const imageFiles = files.filter(file => file.type.startsWith('image/'));
6 const filesToProcess = imageFiles.slice(0, PROMPT_IMAGE_LIMIT - images.filter(Boolean).length);
7
8 if (filesToProcess.length === 0) return;
9
10 const newImages = [...images, ...Array(filesToProcess.length).fill(null)];
11 setImages(newImages);
12
13 const processedImages = await Promise.all(
14 filesToProcess.map(async (file) => {
15 return await readFileAsDataURL(file);
17 );
18
19 const updatedImages = [...images];
20 processedImages.forEach((dataUrl, index) => {
21 updatedImages[images.length + index] = dataUrl;
22 });
23
24 setImages(updatedImages.slice(0, PROMPT_IMAGE_LIMIT));
25};
26
30 reader.onload = () => {
31 const result = reader.result as string;
32 console.log("Image loaded, size:", result.length, "bytes");
33 resolve(result);
34 };

ImageThing

@refactorized•Updated 2 days ago

Gemini-Image-Banana-012 file matches

@aibotcommander•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