madPinkCardinalREADME.md1 match
3This is a lightweight Blob Admin interface to view and debug your Blob data.
45
67Use this button to install the val:
gptMemoryManagerREADME.md2 matches
5First conversation:
67
89What GPT sent do the API:
20Separate conversation somewhere in the future:
2122
2324# Setup
gpt_memoryREADME.md2 matches
5First conversation:
67
89What GPT sent do the API:
20Separate conversation somewhere in the future:
2122
2324# Setup
gptMemoryManagerREADME.md2 matches
5First conversation:
67
89What GPT sent do the API:
20Separate conversation somewhere in the future:
2122
2324# Setup
lightGrayCrowREADME.md1 match
456<img width="400px" src="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/2661d748-d7a7-4d1e-85a4-f60fae262000/public" />
7
hackerNewsDigestREADME.md1 match
456<img width="400px" src="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/2661d748-d7a7-4d1e-85a4-f60fae262000/public" />
7
3435// Run generative model
36const generatedImage = await replicate.run(
37"rapfl/sdxl-zottify:caf6f0e13ef741de9353b0a06146797a4a55fbff3f5f4013e7fe755756a346e1",
38{
47);
4849const result = generatedImage[0];
50// Sending a card with the image in it
51return new Response(
52render(
imagesToPDFmain.tsx17 matches
1/**
2* This application creates a client-side interface for uploading multiple image files
3* and generating a PDF containing those images. It uses the following approach:
4*
5* 1. Create a simple HTML form for file input
6* 2. Use JavaScript to handle file selection and PDF generation
7* 3. Utilize the jsPDF library for PDF creation
8* 4. Use the FileReader API to read image files
9*
10* The application will not modify or convert the images, and each PDF page
11* will be sized according to the corresponding image dimensions.
12*/
1322<meta charset="UTF-8">
23<meta name="viewport" content="width=device-width, initial-scale=1.0">
24<title>Image to PDF Converter</title>
25<link rel="stylesheet" href="/styles.css">
26<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
29<body>
30<div class="container">
31<h1>Image to PDF Converter</h1>
32<input type="file" id="imageInput" accept="image/*" multiple>
33<button id="convertBtn">Convert to PDF</button>
34</div>
86const { jsPDF } = window.jspdf;
8788const imageInput = document.getElementById('imageInput');
89const convertBtn = document.getElementById('convertBtn');
909293async function convertToPDF() {
94const files = imageInput.files;
95if (files.length === 0) {
96alert('Please select at least one image file.');
97return;
98}
99100const [file0] = files;
101const img0 = await loadImage(file0);
102103const pdf = new jsPDF({
112for (let i = 0; i < files.length; i++) {
113const file = files[i];
114const img = await loadImage(file);
115116if (i) pdf.addPage([img.width, img.height]);
117pdf.addImage(img, 'AVIF', 0, 0, img.width, img.height);
118}
119120pdf.save('images.pdf');
121}
122130}
131132function loadImage(blob) {
133return new Promise((resolve, reject) => {
134const src = URL.createObjectURL(blob);
135const img = new Image();
136img.onload = () => resolve(img);
137img.onerror = (e) => reject(e);
bedtimeStoryMakermain.tsx8 matches
124role: "system",
125content:
126`Describe an image that depicts the ${adjective} children's story about a ${color} colored ${animal}: ${summary}.
127The description should be descriptive, but three short sentences.
128Just give me the instructions, don't make an image.`,
129},
130],
143// fast-lightning-sdxl
144const options = {
145"image_size": "square",
146"num_images": 1,
147"num_inference_steps": 6,
148"enable_safety_checker": true,
149};
150// {"num_images": 1,
151// "guidance_scale": 9.5,
152// "num_inference_steps": 20,
153// "expand_prompt": true }
154const result: any = await fal.run(`fal-ai/${falModel}`, { input: { prompt }, options });
155const url = result.images[0].url;
156157return url;
162title: ogData?.title || "Bedtime Story Maker",
163description: ogData?.description || "",
164image: ogData?.image || "",
165url: ogData?.url || `https://dthyresson-bedtimestorymaker.web.val.run/bedtime_stories}`,
166};
480title,
481description: summary,
482image: pictureUrl,
483url: `https://dthyresson-bedtimestorymaker.web.val.run/bedtime_stories/read/${id}`,
484};
generativeFillmain.tsx6 matches
10const lastMsg = req.query.at(-1);
11if (lastMsg && lastMsg.attachments.length !== 2) {
12yield events.replace("No image recieved");
13yield html;
14yield events.done();
15return;
16}
17yield events.replace("Generating image");
18let success = null;
19let error = null;
20const input = {
21image: lastMsg.attachments.at(0).url,
22mask: lastMsg.attachments.at(1).url,
23prompt: lastMsg.content.trim() || "cute kitty",
36let i = 0;
37while (!success && !error) {
38yield events.replace("Generating image (" + (i++) + ")");
39await sleep(1000);
40}
43if (success && Array.isArray(success)) {
44for (const url of success) {
45// yield markdown image
46yield `\n`;
47}
48}