Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
zachey01 committed Jul 30, 2024
1 parent 82e4387 commit 1a8f41b
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ This package can be used in Node.js or Browser environments.
- [🔩 Configurable Options](#-configurable-options)
- [🚀 Chat Completion Providers](#-chat-completion-providers)
- [📚 Chat Completion Models](#-chat-completion-models)
- [📷 Image Generation (BETA)](#-image-generation-beta)
- [📷 Image Generation](#-image-generation)
- [📹 Example usage](#-example-usage)
- [🌐 Image Generation Provider Options](#-image-generation-provider-options)
- [🧮 Number Type Options](#-number-type-options)
- [🖼️ Image Generation Providers](#️-image-generation-providers)
Expand Down Expand Up @@ -239,7 +240,27 @@ const options = {

<a id="image-generation"></a>

# 📷 Image Generation (BETA)
# 📷 Image Generation

<a id="image-gen-usage"></a>

## 📹 Example usage

```js
const options = {
provider: "DALLE2",
};

(async () => {
const provider = GPT4js.createProvider(options.provider);
try {
const base64 = await provider.imageGeneration("wood", options);
console.log(base64);
} catch (error) {
console.error("Error:", error);
}
})();
```

With the `imageGeneration` function, you can generate images from textual input along with optional parameters to customize and stylize the images in various artistic styles.

Expand Down

0 comments on commit 1a8f41b

Please sign in to comment.