* Installing of [Simple mentions phpBB extension](https://www.phpbb.com/customise/db/extension/simple_mentions/) strongly suggested.
[@mention]() feature makes it really easy to talk to AI bots and other board users.
* If you are planning to use image generation AI (eg DALL-E or Stable Diffusion) make sure to adjust attachment settings to support large images and verify that `webp` image extension configured.
Go to `ACP` > `General` > `Attachment settings` and adjust `Total attachment quota`, `Maximum file size` and `Maximum file size messaging`:
Above does not apply to Midjourney, as all generated images are actually stored on your Discord account and served via the Discord CDN.
* If you have extensions installed that require users to log in, such as [Login Required](https://www.phpbb.com/customise/db/extension/login_required) you will need to whitelist `/ailabs/*` and `/app.php/ailabs/*` since AI Labs extension uses callbacks.
* Adjust [PHP configuration](https://www.php.net/manual/en/info.configuration.php) to allow longer script execution. ChatGPT API responses may take up to 90 seconds to respond in certain cases. If you have the default settings, your SQL connection will be closed after 30 seconds, preventing the extension from functioning properly.
If you have a previous version of this extension installed, you will need to disable it and then enable it again after the new version has been copied over.
- Use `Load default configuration/template` to get defaults.
Replace Configuration JSON `api-key`, `discord`, `server` and `channel` with your values.
- Select forums where you want `Midjourney` AI user to reply to new posts and/or to quoted and [@mention](https://www.phpbb.com/customise/db/extension/simple_mentions) (if you are using Simple mentions extension) posts.
* Save changes, navigate to forum configured above and create new post (if you configured `Reply on a post`) or quote/[@mention]() `Midjourney` user:
* You will need OpenAI account, sign up at https://platform.openai.com/.
To obtain API key go to https://platform.openai.com/account/api-keys, click on `Create new secret key`, copy and save in a safe place generated API key.
- Use `Load default configuration/template` to get defaults.
Replace Configuration JSON `api-key` with your Open AI key.
- Select forums where you want `ChatGPT` AI user to reply to new posts and/or to quoted and [@mention](https://www.phpbb.com/customise/db/extension/simple_mentions) (if you are using Simple mentions extension) posts.
* Fine-tuning can be done by adjusting following OpenAI API chat parameters https://platform.openai.com/docs/api-reference/chat
-`model`, default `gpt-3.5-turbo`, full list of models available at https://platform.openai.com/docs/models
-`temperature`, `top_p`, `frequency_penalty` and `presence_penalty` - see https://platform.openai.com/docs/api-reference/chat/create
* Additional setting used by ChatGPT AI
-`message_tokens`, default 4096, limit maximum size of the entire conversation thread
-`max_tokens`, default 1024, define size reserved for AI reply when quoted
-`prefix`, default empty, can be used to prompt model
-`prefix_tokens`, default 0, copy above `prefix` to https://platform.openai.com/tokenizer to get size of your `prefix` in tokens and update `prefix_tokens` with number returned by tokenizer
-`max_quote_length`, if provided, the quoted response text will be truncated to the number of words defined by the max_quote_length value. Set it to 0 to remove all quoted text entirely.
* To generate an image of the desired size, you can specify one of the following sizes anywhere within the prompt, [example](https://privet.fun/viewtopic.php?p=355600#p355600):
- 1024x1024
- 512x512
- 256x256
* To create [variations](https://platform.openai.com/docs/api-reference/images/create-variation) of the image simply post image url to the prompt, [example](https://privet.fun/viewtopic.php?p=355596#p355596)
## Stable Diffusion setup
* You will need Stability AI account, follow official instructions https://platform.stability.ai/docs/getting-started/authentication to create account and obtain API key.
If Log entry is empty it ususally means that `/ailabs/*` or `/app.php/ailabs/*` routes blocked by one of phpBB extensions (eg <ahref="https://www.phpbb.com/customise/db/extension/login_required">Login Required</a>) and you will need to add `/ailabs/*` or `/app.php/ailabs/*` to extension whitelist.
- Fixed links generation for cases where cookies disabled
- AI Labs internal controlles (`/ailabs/*`) will attempt to establish session to deal with phpBB extensions like <ahref="https://www.phpbb.com/customise/db/extension/login_required">Login Required</a>