Optional
prompt: stringThe prompt to use for the image generation.
Optional
params: StableHordeRequestParametersThe request parameters.
Registers an event handler for the created
event. This event will run
when the request is created on Stable Horde's API.
Optional
event: "created"Created event.
Optional
handler: ((data: StableHordeQueuedRequest) => void)The callback. Receives a {StableHordeQueuedRequest} as its only argument.
Registers an event handler for the statusPolled
event. This event will
run every time the status of the request is polled.
Optional
event: "statusPolled"Status polled event.
Optional
handler: ((data: StableHordeRequestStatus) => void)The callback. Receives a {StableHordeRequestStatus} as its only argument.
Registers an event handler for the finished
event. This event will run
when the image generation has finished.
Optional
event: "finished"Finished event.
Optional
handler: ((data: StableHordeGenerations) => void)The callback. Receives a {StableHordeGenerations} object as its only argument.
Registers an event for the error
event. This event will run when an
error occurs.
Optional
event: "error"Error event.
Optional
handler: ((data: any) => void)The callback. Receives an error as its only argument.
Generated using TypeDoc
Creates a new image generation request emitting the
create
event. Then it will poll the status of the request until it is done, emitting astatusPolled
event on every iteration. When the request is done, it will emit afinished
event.Returns
A reference to itself.