Generate images using text
Basic usage
import Bytez from "bytez.js";
const sdk = new Bytez("BYTEZ_KEY");
const model = sdk.model("dreamlike-art/dreamlike-photoreal-2.0");
await model.create()
const { error, output } = await model.run("A beautiful landscape with mountains and a river");
console.log({ error, output });
Stream
import Bytez from "bytez.js";
const sdk = new Bytez("BYTEZ_KEY");
const model = sdk.model("dreamlike-art/dreamlike-photoreal-2.0");
await model.create()
const text = "A beautiful landscape with mountains and a river"
const stream = true
const readStream = await model.run(text, stream);
// the stream returns the base64 data url
for await (const chunk of readStream) {
console.log(chunk)
}