Spaces:
Runtime error
Runtime error
Commit
·
793c1b3
1
Parent(s):
51dbf06
add alt
Browse files- src/app/engine/render.ts +2 -0
- src/app/main.tsx +1 -0
- src/types.ts +4 -1
src/app/engine/render.ts
CHANGED
@@ -39,6 +39,7 @@ export async function newRender({
|
|
39 |
renderId: "",
|
40 |
status: "error",
|
41 |
assetUrl: "",
|
|
|
42 |
maskUrl: "",
|
43 |
error: "failed to fetch the data",
|
44 |
segments: []
|
@@ -117,6 +118,7 @@ export async function getRender(renderId: string) {
|
|
117 |
renderId: "",
|
118 |
status: "error",
|
119 |
assetUrl: "",
|
|
|
120 |
maskUrl: "",
|
121 |
error: "failed to fetch the data",
|
122 |
segments: []
|
|
|
39 |
renderId: "",
|
40 |
status: "error",
|
41 |
assetUrl: "",
|
42 |
+
alt: prompt || "",
|
43 |
maskUrl: "",
|
44 |
error: "failed to fetch the data",
|
45 |
segments: []
|
|
|
118 |
renderId: "",
|
119 |
status: "error",
|
120 |
assetUrl: "",
|
121 |
+
alt: "",
|
122 |
maskUrl: "",
|
123 |
error: "failed to fetch the data",
|
124 |
segments: []
|
src/app/main.tsx
CHANGED
@@ -32,6 +32,7 @@ const getInitialRenderedScene = (): RenderedScene => ({
|
|
32 |
renderId: "",
|
33 |
status: "pending",
|
34 |
assetUrl: "",
|
|
|
35 |
error: "",
|
36 |
maskUrl: "",
|
37 |
segments: []
|
|
|
32 |
renderId: "",
|
33 |
status: "pending",
|
34 |
assetUrl: "",
|
35 |
+
alt: "",
|
36 |
error: "",
|
37 |
maskUrl: "",
|
38 |
segments: []
|
src/types.ts
CHANGED
@@ -43,6 +43,8 @@ export interface RenderRequest {
|
|
43 |
cache: CacheMode
|
44 |
|
45 |
wait: boolean // wait until the job is completed
|
|
|
|
|
46 |
}
|
47 |
|
48 |
export interface ImageSegment {
|
@@ -69,7 +71,8 @@ export type SceneEvent =
|
|
69 |
export interface RenderedScene {
|
70 |
renderId: string
|
71 |
status: RenderedSceneStatus
|
72 |
-
assetUrl: string
|
|
|
73 |
error: string
|
74 |
maskUrl: string
|
75 |
segments: ImageSegment[]
|
|
|
43 |
cache: CacheMode
|
44 |
|
45 |
wait: boolean // wait until the job is completed
|
46 |
+
|
47 |
+
analyze: boolean // analyze the image to generate a caption (optional)
|
48 |
}
|
49 |
|
50 |
export interface ImageSegment {
|
|
|
71 |
export interface RenderedScene {
|
72 |
renderId: string
|
73 |
status: RenderedSceneStatus
|
74 |
+
assetUrl: string
|
75 |
+
alt: string
|
76 |
error: string
|
77 |
maskUrl: string
|
78 |
segments: ImageSegment[]
|