fix: some stuff

This commit is contained in:
2023-11-06 02:36:23 +01:00
parent 19a311dc82
commit 48b21a9b3a
6 changed files with 6 additions and 407 deletions

View File

@ -1,15 +1,15 @@
import { json } from "@sveltejs/kit";
import type { RequestHandler } from "./$types";
import { putObject } from "$lib/helpers/s3";
import { putObject } from "$lib/helpers/minio";
import { generateImage } from "$lib/helpers/stability";
export const GET: RequestHandler = async ({ params }) => {
const inputName = params.name;
const prompt = `realistic profile portrait oil painting of a masked ${inputName}, baroque, Charles Vess, masked ball attire, Charles Vess, opulence, mystery, elegance, medium-length blond hair, darker skin`;
const negativePrompt = "blurry, multiple persons, picture frame"
const a = performance.now()
const image = await generateImage(prompt, negativePrompt);
const duration = performance.now() - a;

View File

@ -1,25 +0,0 @@
import { json } from "@sveltejs/kit";
import type { RequestHandler } from "./$types";
import { putObject } from "$lib/helpers/s3";
export const GET: RequestHandler = async ({ params }) => {
const inputName = params.name;
const prompt = `upper body realistic portrait oil painting of a masked ${inputName}, Baroque, Charles Vess, masked ball attire, Charles Vess, opulence, mystery, elegance, dark long hair`;
const negativePrompt = "blurry, multiple persons, picture frame";
const image = generateImage(prompt, negativePrompt);
const imageName = `txt2img_${image.seed}.png`;
const res = await putObject(imageName, Buffer.from(image.base64, 'base64'), { contentType: "image/png" });
return json({
...res,
url: `https://s3.app.max-richter.dev/silvester23/${imageName}`
});
};

View File

@ -1,8 +0,0 @@
import { getBuckets } from "$lib/helpers/s3";
import { json } from "@sveltejs/kit";
import type { RequestHandler } from "./$types";
export const GET: RequestHandler = async () => {
const buckets = await getBuckets()
return json(buckets)
}