mirror of
https://github.com/shadcn-ui/taxonomy
synced 2026-05-24 09:48:32 +00:00
Fix types
This commit is contained in:
parent
7f80186e19
commit
a09221bb26
3 changed files with 18 additions and 16 deletions
|
|
@ -110,7 +110,6 @@ export const pixelateImageScenario = async ({
|
|||
const pixelateData: ScenarioPixelateResponse = await pixelateResponse.json()
|
||||
|
||||
|
||||
console.log("pixelate data response", pixelateData)
|
||||
// @ts-ignore
|
||||
return pixelateData.asset
|
||||
}
|
||||
|
|
@ -153,11 +152,9 @@ export async function GET(
|
|||
}
|
||||
).then((res) => res.json())
|
||||
|
||||
console.log(jobProgress)
|
||||
|
||||
// If the job was successful, process the images and update credits
|
||||
if (jobProgress.job.status === "success") {
|
||||
console.log("Job success")
|
||||
// Wrap this in try-catch since findUniqueOrThrow can fail
|
||||
try {
|
||||
const generation = await db.generation.findUniqueOrThrow({
|
||||
|
|
@ -172,8 +169,6 @@ export async function GET(
|
|||
},
|
||||
})
|
||||
|
||||
console.log("generateion jere", generation)
|
||||
|
||||
// If already processed, return existing output images
|
||||
if (generation.status === "COMPLETE") {
|
||||
return new Response(
|
||||
|
|
@ -227,8 +222,6 @@ export async function GET(
|
|||
})
|
||||
)
|
||||
|
||||
console.log("pixelateImages", pixelatedImages)
|
||||
console.log("jobProgress.job.metadata.assetIds", jobProgress.job.metadata.assetIds)
|
||||
|
||||
const imagesWithPixelated = jobProgress.job.metadata.assetIds.map(
|
||||
(assetId, index) => {
|
||||
|
|
@ -242,8 +235,6 @@ export async function GET(
|
|||
}
|
||||
)
|
||||
|
||||
console.log("imagesWithPixelated", imagesWithPixelated)
|
||||
console.log("generation", generation)
|
||||
|
||||
await db.$transaction([
|
||||
db.user.update({
|
||||
|
|
|
|||
|
|
@ -85,8 +85,9 @@ export const GenerationSet = ({
|
|||
jsonResponse?.outputImages
|
||||
) {
|
||||
generatedImages = jsonResponse.outputImages
|
||||
|
||||
setImages(generatedImages)
|
||||
if (generatedImages) {
|
||||
setImages(generatedImages)
|
||||
}
|
||||
} else if (jsonResponse.job?.status === "failed") {
|
||||
toast({
|
||||
title: "Generation failed",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { Generation, OutputImage } from "@prisma/client"
|
||||
|
||||
export interface ScenarioInferenceResponse {
|
||||
inference: Inference
|
||||
job: Job
|
||||
}
|
||||
|
||||
|
|
@ -40,23 +41,32 @@ export interface Inference {
|
|||
authorId: string
|
||||
modelId: string
|
||||
createdAt: string
|
||||
parameters: Parameters
|
||||
parameters: InferenceParameters
|
||||
status: string
|
||||
images: any[]
|
||||
images: InferenceImage[]
|
||||
imagesNumber: number
|
||||
displayPrompt: string
|
||||
}
|
||||
|
||||
export interface Parameters {
|
||||
export interface InferenceParameters {
|
||||
numSamples: number
|
||||
guidance: number
|
||||
numInferenceSteps: number
|
||||
enableSafetyCheck: boolean
|
||||
width: number
|
||||
height: number
|
||||
type: string
|
||||
prompt: string
|
||||
strength: number
|
||||
negativePrompt?: string
|
||||
strength?: number
|
||||
modality?: string
|
||||
image?: string
|
||||
}
|
||||
|
||||
export interface InferenceImage {
|
||||
id: string
|
||||
url: string
|
||||
seed: string
|
||||
pixelated?: string
|
||||
}
|
||||
|
||||
export interface ScenarioInferenceProgressResponse {
|
||||
|
|
|
|||
Loading…
Reference in a new issue