web_aoEiUErLLmmain.tsx1 match
75width: 100%;
76height: 100%;
77background: url('https://images.unsplash.com/photo-1506318137071-a8e063b4bec0?auto=format&fit=crop&w=1950&q=80') center/cover;
78opacity: 0.3;
79z-index: -1;
xmasRedHamstermain.tsx9 matches
1112try {
13const imageUrl = await getMostPopularPinterestImage(query);
14return new Response(JSON.stringify({ image: imageUrl }), {
15headers: {
16"Content-Type": "application/json",
26}
2728async function getMostPopularPinterestImage(query: string): Promise<string> {
29const searchUrl = `https://api.pinterest.com/v5/search/pins?query=${encodeURIComponent(query)}&page_size=50&sort_order=popularity`;
30const response = await fetch(searchUrl, {
46const mostPopularPin = sortedPins[0];
4748if (mostPopularPin.images) {
49// Get the largest available image
50const images = mostPopularPin.images;
51const largestImage = images[images.length - 1];
52return largestImage.url;
53}
54}
5556throw new Error("No popular image found");
57}
xmasRedHamstermain.tsx9 matches
1112try {
13const imageUrl = await getMostPopularPinterestImage(query);
14return new Response(JSON.stringify({ image: imageUrl }), {
15headers: {
16"Content-Type": "application/json",
26}
2728async function getMostPopularPinterestImage(query: string): Promise<string> {
29const searchUrl = `https://api.pinterest.com/v5/search/pins?query=${encodeURIComponent(query)}&page_size=50&sort_order=popularity`;
30const response = await fetch(searchUrl, {
46const mostPopularPin = sortedPins[0];
4748if (mostPopularPin.images) {
49// Get the largest available image
50const images = mostPopularPin.images;
51const largestImage = images[images.length - 1];
52return largestImage.url;
53}
54}
5556throw new Error("No popular image found");
57}
val_Lp66OGSTA8main.tsx1 match
4// Execute the code directly and capture its result
5const result = await (async () => {
6// Create a pixel art cat inspired by the pixel art shown in the reference image
7const pixelKitty = `
8â â
val_FASG6Vrgm2main.tsx1 match
4// Execute the code directly and capture its result
5const result = await (async () => {
6// Create a pixel art cat inspired by the pixel art shown in the reference image
7const pixelKitty = `
8ââ ââ
val_9knOr9vyzBmain.tsx1 match
4// Execute the code directly and capture its result
5const result = await (async () => {
6// Create a pixel art style cat similar to the image
7const pixelCat = `
8âââââââŽ
web_mBvDDUywvrmain.tsx1 match
39<h1>đ Awesome Website</h1>
40<p>Created to make your day a little more colorful!</p>
41<img src="https://picsum.photos/300/200" alt="Random Cool Image">
42</div>
43</body>
generateframeImageREADME.md1 match
1# Gathers information and returns an image of this val
23### Why
generateframeImagemain.tsx10 matches
142}
143144async function generateImage(html: string): Promise<Response> {
145const apiKey = Deno.env.get("API_FLASH_KEY");
146const encodedHtml = encodeURIComponent(html);
147const url =
148`https://api.apiflash.com/v1/urltoimage?access_key=${apiKey}&url=https://michaelwschultz-generateframeimage.web.val.run&width=800&height=480&format=png&fresh=true`;
149150try {
155return response;
156} catch (error) {
157console.error("Error generating image:", error);
158return new Response("Failed to generate image", { status: 500 });
159}
160}
162export default async function(req: Request) {
163const url = new URL(req.url);
164const isImageRequest = url.searchParams.get("generate") === "image";
165166const latitude = 37.5296;
170const html = renderToString(<WeatherDisplay weather={weather} />);
171172if (isImageRequest) {
173const imageResponse = await generateImage(html);
174return new Response(imageResponse.body, {
175status: imageResponse.status,
176headers: {
177"Content-Type": "image/png",
178"Cache-Control": "no-store, max-age=0",
179},
falDemoAppmain.tsx22 matches
7function App() {
8const [prompt, setPrompt] = useState("");
9const [imageUrls, setImageUrls] = useState<string[]>([]);
10const [loading, setLoading] = useState(false);
11const [numImages, setNumImages] = useState(1);
1213const generateImage = async (e?: React.FormEvent) => {
14e?.preventDefault();
15setLoading(true);
16setImageUrls([]);
17const fal = createFalClient({
18proxyUrl: "/api/fal/proxy",
2021try {
22const requests = Array(numImages).fill(null).map(() =>
23fal.run("fal-ai/flux-pro/v1.1", {
24input: {
25prompt,
26image_size: "landscape_4_3",
27num_inference_steps: 4,
28num_images: 1,
29enable_safety_checker: true,
30sync_mode: true,
3435const results = await Promise.all(requests);
36const newImageUrls = results.flatMap(result => result.data.images.map((img: any) => img.url));
37setImageUrls(newImageUrls);
38} catch (error) {
39console.error("Error generating image:", error);
40} finally {
41setLoading(false);
46<div className="min-h-screen bg-black text-white py-12 px-4 sm:px-6 lg:px-8">
47<div className="max-w-4xl mx-auto">
48<h1 className="text-4xl font-bold text-center mb-8">Fal AI Image Generator</h1>
49<div className="bg-gray-900 rounded-lg p-6 mb-8 shadow-lg">
50<form className="flex flex-col sm:flex-row gap-4" onSubmit={generateImage}>
51<input
52type="text"
53value={prompt}
54onChange={(e) => setPrompt(e.target.value)}
55placeholder="Enter your image prompt"
56className="flex-grow px-4 py-2 bg-gray-800 border border-gray-700 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-transparent"
57/>
58<select
59value={numImages}
60onChange={(e) => setNumImages(Number(e.target.value))}
61className="px-4 py-2 bg-gray-800 border border-gray-700 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-transparent"
62>
63{[1, 2, 3, 4, 10].map((num) => (
64<option key={num} value={num}>
65{num} {num === 1 ? 'image' : 'images'}
66</option>
67))}
68</select>
69<button
70onClick={generateImage}
71disabled={loading || !prompt}
72className={`px-6 py-2 rounded-md text-white font-medium transition-colors duration-200 ${
98)
99: (
100"Generate Image"
101)}
102</button>
103</form>
104</div>
105{imageUrls.length > 0 && (
106<div className="grid grid-cols-1 gap-4">
107{imageUrls.map((url, index) => (
108<div key={index} className="bg-gray-900 rounded-lg overflow-hidden shadow-lg">
109<img src={url} alt={`Generated image ${index + 1}`} className="w-full h-auto" />
110</div>
111))}
140<meta charset="UTF-8">
141<meta name="viewport" content="width=device-width, initial-scale=1.0">
142<title>Fal AI Image Generator</title>
143<script src="https://cdn.tailwindcss.com"></script>
144<style>