poc streaming image response

This commit is contained in:
caranicas 2022-09-26 17:06:42 -04:00
parent 6effd783c0
commit afd8717c21
2 changed files with 8 additions and 0 deletions

View File

@ -44,6 +44,12 @@ const LoadingDisplay = () => {
<> <>
<h4 className="loading">Loading...</h4> <h4 className="loading">Loading...</h4>
<p>{percent} % Complete </p> <p>{percent} % Complete </p>
{progressImages.map((image, index) => {
return (
<img src={`http://localhost:9000${image}`} key={index} />
)
})
}
</> </>
); );
}; };

View File

@ -22,6 +22,7 @@ export const SAMPLER_OPTIONS = [
] as const; ] as const;
export interface ImageRequest { export interface ImageRequest {
session_id: string;
prompt: string; prompt: string;
seed: number; seed: number;
num_outputs: number; num_outputs: number;
@ -118,6 +119,7 @@ export const useImageCreate = create<ImageCreateState>(
parallelCount: 1, parallelCount: 1,
requestOptions: { requestOptions: {
session_id: new Date().getTime().toString(),
prompt: "a photograph of an astronaut riding a horse", prompt: "a photograph of an astronaut riding a horse",
seed: useRandomSeed(), seed: useRandomSeed(),
num_outputs: 1, num_outputs: 1,