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=592&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 7074 results for "image"(2201ms)

tidyPurpleSheepREADME.md1 match

@mforondaUpdated 5 months ago
3Monitor any news form your inbox.
4
5![image.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/9d312ee9-68f6-4e55-ab4f-57aec4e0c000/public)
6
7Fork this val then configure:

aiImageGeneratormain.tsx28 matches

@jumptoaiUpdated 5 months ago
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function ImageGenerator() {
6 const [imageUrl, setImageUrl] = useState<string | null>(null);
7 const [prompt, setPrompt] = useState("");
8 const [isLoading, setIsLoading] = useState(false);
9 const [error, setError] = useState<string | null>(null);
10
11 const generateImage = async (e: React.FormEvent) => {
12 e.preventDefault();
13 setIsLoading(true);
17 // Validate prompt
18 if (!prompt.trim()) {
19 throw new Error('Please enter a description for the image');
20 }
21
22 // Use a more robust image generation endpoint
23 const response = await fetch(`https://maxm-imggenurl.web.val.run/${encodeURIComponent(prompt)}`, {
24 method: 'GET',
25 headers: {
26 'Accept': 'image/*'
27 }
28 });
30 if (!response.ok) {
31 const errorText = await response.text();
32 throw new Error(errorText || 'Image generation failed');
33 }
34
35 const blob = await response.blob();
36 const url = URL.createObjectURL(blob);
37 setImageUrl(url);
38 } catch (err) {
39 console.error('Image generation error:', err);
40 setError(err instanceof Error ? err.message : "An unknown error occurred");
41 } finally {
45
46 const resetGenerator = () => {
47 setImageUrl(null);
48 setPrompt("");
49 setError(null);
52 return (
53 <div style={styles.container}>
54 <h1 style={styles.title}>🎨 AI Image Generator</h1>
55 {!imageUrl ? (
56 <form onSubmit={generateImage} style={styles.form}>
57 <input
58 type="text"
59 value={prompt}
60 onChange={(e) => setPrompt(e.target.value)}
61 placeholder="Describe the image you want to generate (e.g., 'A sunset over mountains')"
62 style={styles.input}
63 required
68 style={styles.button}
69 >
70 {isLoading ? "Generating..." : "Generate Image"}
71 </button>
72 </form>
88 )}
89
90 {imageUrl && (
91 <div style={styles.imageContainer}>
92 <img
93 src={imageUrl}
94 alt="Generated"
95 style={styles.image}
96 />
97 <a
98 href={imageUrl}
99 download="generated_image.png"
100 style={styles.downloadButton}
101 >
102 Download Image
103 </a>
104 </div>
152 marginBottom: '20px',
153 },
154 imageContainer: {
155 display: 'flex',
156 flexDirection: 'column',
158 gap: '10px',
159 },
160 image: {
161 maxWidth: '100%',
162 borderRadius: '10px',
181 <head>
182 <meta charset="UTF-8">
183 <title>AI Image Generator</title>
184 <meta name="viewport" content="width=device-width, initial-scale=1">
185 <script src="https://esm.town/v/std/catch"></script>
206 import { createRoot } from "https://esm.sh/react-dom/client";
207
208 function ImageGenerator() {
209 ${ImageGenerator.toString()}
210 }
211
215 const rootElement = document.getElementById("root");
216 if (rootElement) {
217 createRoot(rootElement).render(React.createElement(ImageGenerator));
218 }
219 }

sqliteExplorerAppREADME.md1 match

@cameronpakUpdated 5 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

blueskySearchPostsDemoREADME.md1 match

@stevekrouseUpdated 5 months ago
55 text: "@stevekrouse.com can't tell what happened, but I was using Townie for a thing and it inverted the reasoning and code outputs for whatever reason."
56 },
57 embed: { "$type": "app.bsky.embed.images#view", images: [Array] },
58 replyCount: 1,
59 repostCount: 0,

slothdaobotREADME.md1 match

@artivillaUpdated 5 months ago
13
14
15![CleanShot 2024-11-25 at 22.46.31.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/d0bce97c-37c7-4301-32a3-c9e6cb241c00/public)
16
17

farcasterKeyHookREADME.md2 matches

@artivillaUpdated 5 months ago
13
14
15![CleanShot 2024-11-25 at 18.21.48.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/6277a3c8-a4a2-47dd-ee37-5ed322864300/public)
16
17![CleanShot 2024-11-25 at 07.42.21.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/6b88f1e3-a307-426b-83a1-9159df273800/public)
18

ThankYouNoteGeneratormain.tsx1 match

@willthereaderUpdated 5 months ago
581 right: 0;
582 bottom: 0;
583 background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAUVBMVEWFhYWDg4N3d3dtbW17e3t1dXWBgYGHh4d5eXlzc3OLi4ubm5uVlZWPj4+NjY19fX2JiYl/f39ra2uRkZGZmZlpaWmXl5dvb29xcXGTk5NnZ2c8TV1mAAAAG3RSTlNAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAvEOwtAAAFVklEQVR4XpWWB67c2BUFb3g557T/hRo9/WUMZHlgr4Bg8Z4qQgQJlHI4A8SzFVrapvmTF9O7dmYRFZ60YiBhJRCgh1FYhiLAmdvX0CzTOpNE77ME0Zty/nWWzchDtiqrmQDeuv3powQ5ta2eN0FY0InkqDD73lT9c9lEzwUNqgFHs9VQce3TVClFCQrSTfOiYkVJQBmpbq2L6iZavPnAPcoU0dSw0SUTqz/GtrGuXfbyyBniKykOWQWGqwwMA7QiYAxi+IlPdqo+hYHnUt5ZPfnsHJyNiDtnpJyayNBkF6cWoYGAMY92U2hXHF/C1M8uP/ZtYdiuj26UdAdQQSXQErwSOMzt/XWRWAz5GuSBIkwG1H3FabJ2OsUOUhGC6tK4EMtJO0ttC6IBD3kM0ve0tJwMdSfjZo+EEISaeTr9P3wYrGjXqyC1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Q9Jq+f8XN+A5eeUKHWvJWJ2sgJ1Sop+wwhqFVijqWaJhwtD8MNlSBeWNNWTa5Z5kPZw5+LbVT99wqTdx29lMUH4OIG/D86ruKEauBjvH5xy6um/Sfj7ei6UUVk4AIl3MyD4MSSTOFgSwsH/QJWaQ5as7ZcmgBZkzjjU1UrQ74ci1gWBCSGHtuV1H2mhSnO3Wp/3fEV5a+4wz//6qy8JxjZsmxxy5+4w9CDNJY09T072iKG0EnOS0arEYgXqYnXcYHwjTtUNAcMelOd4xpkoqiTYICWFq0JSiPfPDQdnt+4/wuqcXY47QILbgAAAABJRU5ErkJggg==");
584 opacity: 0.1;
585 z-index: 0;

fullWebsiteCheckermain.tsx1 match

@willthereaderUpdated 5 months ago
227 headers: {
228 "User-Agent": userAgent,
229 "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
230 "Accept-Language": "en-US,en;q=0.5",
231 "Referer": "https://www.google.com/",

sapientLavenderHerringmain.tsx1 match

@maxmUpdated 5 months ago
46 transform: scaleX(1);
47 transform-origin: center;
48 background-image: linear-gradient(45deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3);
49 background-clip: text;
50 background-size: 300% 300%;

imggenpromain.tsx63 matches

@andiebukUpdated 5 months ago
5function App() {
6 const [prompt, setPrompt] = useState("");
7 const [imageData, setImageData] = useState("");
8 const [loading, setLoading] = useState(false);
9 const [error, setError] = useState("");
14 setLoading(true);
15 setError("");
16 setImageData("");
17 try {
18 const response = await fetch("/generate", {
29 }
30
31 // Ensure we have a valid base64 image with data URI prefix
32 const fullBase64Image = data.image.startsWith('data:image')
33 ? data.image
34 : `data:image/png;base64,${data.image}`;
35
36 setImageData(fullBase64Image);
37 console.log("Image data received:", fullBase64Image.slice(0, 100) + "...");
38 } catch (error) {
39 console.error("Error generating image:", error);
40 setError(error.message || "Failed to generate image");
41 } finally {
42 setLoading(false);
50 return (
51 <div className="container">
52 <h1>Image Generation</h1>
53 <form onSubmit={handleSubmit}>
54 <input
56 value={prompt}
57 onChange={handleInputChange}
58 placeholder="Describe the image you want to generate..."
59 className="input"
60 />
61 <button type="submit" className="submit-btn" disabled={loading}>
62 {loading ? "Generating..." : "Generate Image"}
63 </button>
64 </form>
65 {loading && <p className="loading">Generating image, please wait...</p>}
66 {error && <p className="error">Error: {error}</p>}
67 {imageData && (
68 <div className="image-container">
69 <h2>Generated Image:</h2>
70 <img
71 src={imageData}
72 alt="Generated image"
73 className="generated-image"
74 onError={(e) => {
75 console.error("Image failed to load", e);
76 setError("Failed to render image");
77 }}
78 />
91}
92
93// Utility function to validate and adjust image dimensions
94function validateImageDimensions(width: number, height: number): {
95 width: number,
96 height: number,
137export default async function server(request: Request): Promise<Response> {
138 const url = new URL(request.url);
139 const imagePrompt = url.searchParams.get('image');
140
141 // Parse width and height with advanced validation
148 height: safeHeight,
149 warnings
150 } = validateImageDimensions(rawWidth, rawHeight);
151
152 if (url.pathname === "/generate" && request.method === "POST") {
164 console.log("Received prompt:", prompt);
165
166 const togetherApiUrl = "https://api.together.xyz/v1/images/generations";
167 console.log("Sending request to Together AI API:", togetherApiUrl);
168
194 console.log("Together AI API full response:", JSON.stringify(result, null, 2));
195
196 // Robust extraction of base64 image data
197 let imageBase64;
198 if (result.data && Array.isArray(result.data) && result.data.length > 0) {
199 imageBase64 = result.data[0].b64_json || result.data[0];
200 } else if (result.b64_json) {
201 imageBase64 = result.b64_json;
202 } else if (result.data && result.data.b64_json) {
203 imageBase64 = result.data.b64_json;
204 } else {
205 console.error("Unexpected response structure:", result);
206 throw new Error("No image found in API response");
207 }
208
209 // Ensure imageBase64 is a string and trim any whitespace
210 imageBase64 = (typeof imageBase64 === 'string' ? imageBase64 : JSON.stringify(imageBase64)).trim();
211
212 console.log("Extracted image base64 (first 100 chars):", imageBase64.slice(0, 100));
213
214 // Include warnings in the response if any
215 return new Response(JSON.stringify({
216 image: imageBase64,
217 warnings: warnings.length > 0 ? warnings : undefined
218 }), {
220 });
221 } catch (error) {
222 console.error("Error generating image:", error.message);
223 console.error("Full error details:", error);
224 return new Response(JSON.stringify({ error: error.message || "Failed to generate image" }), {
225 status: 500,
226 headers: { "Content-Type": "application/json" },
229 }
230
231 // Handle direct image generation from URL query
232 if (imagePrompt) {
233 const apiKey = Deno.env.get("TOGETHER_API_KEY");
234 if (!apiKey) {
237
238 try {
239 const togetherApiUrl = "https://api.together.xyz/v1/images/generations";
240 const response = await fetch(togetherApiUrl, {
241 method: "POST",
246 body: JSON.stringify({
247 model: "black-forest-labs/FLUX.1-schnell",
248 prompt: imagePrompt,
249 width: safeWidth,
250 height: safeHeight,
260
261 const result = await response.json();
262 let imageBase64;
263 if (result.data && Array.isArray(result.data) && result.data.length > 0) {
264 imageBase64 = result.data[0].b64_json || result.data[0];
265 } else if (result.b64_json) {
266 imageBase64 = result.b64_json;
267 } else if (result.data && result.data.b64_json) {
268 imageBase64 = result.data.b64_json;
269 } else {
270 throw new Error("No image found in API response");
271 }
272
273 // Ensure imageBase64 is a string and trim any whitespace
274 imageBase64 = (typeof imageBase64 === 'string' ? imageBase64 : JSON.stringify(imageBase64)).trim();
275
276 // If the request accepts HTML, return a full HTML page with the image
277 if (request.headers.get('Accept')?.includes('text/html')) {
278 return new Response(`
280 <html>
281 <head>
282 <title>Generated Image</title>
283 <style>
284 body {
291 font-family: Arial, sans-serif;
292 }
293 .image-container {
294 text-align: center;
295 }
306 </head>
307 <body>
308 <div class="image-container">
309 <img src="data:image/png;base64,${imageBase64}" alt="Generated image for: ${imagePrompt}" width="${safeWidth}" height="${safeHeight}">
310 ${warnings.length > 0 ? `
311 <div class="warning">
312 <p>⚠️ Image dimensions adjusted:</p>
313 <ul>
314 ${warnings.map(warning => `<li>${warning}</li>`).join('')}
324 }
325
326 // Otherwise, return the base64 image directly
327 return new Response(imageBase64, {
328 headers: {
329 'Content-Type': 'image/png',
330 'X-Image-Warnings': warnings.length > 0 ? JSON.stringify(warnings) : ''
331 }
332 });
345 <meta charset="UTF-8">
346 <meta name="viewport" content="width=device-width, initial-scale=1.0">
347 <title>Image Generation</title>
348 <style>${css}</style>
349 </head>
408 cursor: not-allowed;
409 }
410 .image-container {
411 margin-top: 20px;
412 }
413 .generated-image {
414 max-width: 100%;
415 height: auto;

Imagetourl2 file matches

@dcm31Updated 13 hours ago

thilenius-webcam1 file match

@stabbylambdaUpdated 4 days ago
Image proxy for the latest from https://gliderport.thilenius.com
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