4import { ValSession } from "https://esm.town/v/maxm/valSession";
5
6// Generate a token from your valtown api key.
7const token = await ValSession.newSession(Deno.env.get("valtown"));
8
1null
2
3Migrated from folder: wide/wideApi
1/** @jsxImportSource https://esm.sh/react */
2import { AtpAgent } from "https://esm.sh/@atproto/api@0.13.15";
3import { AnimatePresence, motion } from "https://esm.sh/framer-motion";
4import React, { useEffect, useMemo, useRef, useState } from "https://esm.sh/react";
6import { TagCloud } from "https://esm.sh/react-tagcloud@2.2.0";
7
8const service = "https://public.api.bsky.app";
9const agent = new AtpAgent({ service });
10
250 </script>
251 <style>
252 @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');
253 body {
254 font-family: 'Inter', sans-serif;
11[](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
12
13It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
14
15# TODO
11subject to caching. It'd be an improvement to this tool if we
12could add an uncached DNS check in here. In a couple min I wasn't
13able to find a free DNS checker API. Pull requests welcome!
11[](https://www.val.town/v/stevekrouse/blob_admin_app/fork)
12
13It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
14
15# TODO
123 }
124
125 const REPLICATE_API_KEY = Deno.env.get("REPLICATE_API_KEY");
126
127 if (REPLICATE_API_KEY) {
128 const modelVersion = useProModel ? "black-forest-labs/flux-1.1-pro" : "black-forest-labs/flux-schnell";
129 const settings = {
130 outputFormat: "jpg",
131 outputQuality: 90,
132 megapixels: "1",
133 };
134
135 console.log("Sending initial request to Replicate...");
136 const response = await fetch(`https://api.replicate.com/v1/models/${modelVersion}/predictions`, {
137 method: "POST",
138 headers: {
139 "Content-Type": "application/json",
140 "Authorization": `Bearer ${REPLICATE_API_KEY}`,
141 },
142 body: JSON.stringify({
146 output_quality: settings.outputQuality,
147 disable_safety_checker: true,
148 megapixels: settings.megapixels,
149 },
150 }),
159 const resultResponse = await fetch(prediction.urls.get, {
160 headers: {
161 "Authorization": `Token ${REPLICATE_API_KEY}`,
162 },
163 });
1๐ **Shirtgen API Endpoint**
2
3Shirtgen lets you generate AI-powered t-shirt designs with just a prompt! ๐๏ธ Choose between the standard "Flux Schnell" model or the enhanced "Pro" model. Perfect for creating unique custom apparel in seconds! ๐
91 }
92
93 const REPLICATE_API_KEY = Deno.env.get("REPLICATE_API_KEY");
94
95 if (REPLICATE_API_KEY) {
96 const modelVersion = useProModel ? "black-forest-labs/flux-1.1-pro" : "black-forest-labs/flux-schnell";
97 const settings = {
98 outputFormat: "jpg",
99 outputQuality: 90,
100 megapixels: "1",
101 };
102
103 console.log("Sending initial request to Replicate...");
104 const response = await fetch(`https://api.replicate.com/v1/models/${modelVersion}/predictions`, {
105 method: "POST",
106 headers: {
107 "Content-Type": "application/json",
108 "Authorization": `Bearer ${REPLICATE_API_KEY}`,
109 },
110 body: JSON.stringify({
114 output_quality: settings.outputQuality,
115 disable_safety_checker: true,
116 megapixels: settings.megapixels,
117 },
118 }),
127 const resultResponse = await fetch(prediction.urls.get, {
128 headers: {
129 "Authorization": `Token ${REPLICATE_API_KEY}`,
130 },
131 });
1๐ **Shirtgen API Endpoint**
2
3Shirtgen lets you generate AI-powered t-shirt designs with just a prompt! ๐๏ธ Choose between the standard "Flux Schnell" model or the enhanced "Pro" model. Perfect for creating unique custom apparel in seconds! ๐