Merge pull request 'Created README' (#8) from dev into main
Reviewed-on: #8
This commit is contained in:
commit
ed3cd1df57
52
README.md
52
README.md
@ -1,2 +1,52 @@
|
|||||||
# novelai-bot
|
# NovelAI Discord Bot
|
||||||
|
|
||||||
|

|
||||||
|

|
||||||
|

|
||||||
|
|
||||||
|
Simple bot which registers a command to generate images via the NovelAI API.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Just enter `/generate` in the desired channel.
|
||||||
|
|
||||||
|
```text
|
||||||
|
/generate
|
||||||
|
*prompt: string
|
||||||
|
undesired_prompt: string
|
||||||
|
orientation: landscape or portrait
|
||||||
|
seed: integer
|
||||||
|
```
|
||||||
|
|
||||||
|
`*: required`
|
||||||
|
|
||||||
|
## Run
|
||||||
|
|
||||||
|
You might create environvent vars:
|
||||||
|
|
||||||
|
- **NOVELAI_API_TOKEN**: your NovelAI user API key
|
||||||
|
- **DISCORD_BOT_TOKEN**: token of your Discord bot
|
||||||
|
- **DISCORD_CHANNEL_ID**: ID of the channel to enable this bot
|
||||||
|
|
||||||
|
Don't forget to install the requirements in [requirements.txt](src/requirements.txt)
|
||||||
|
|
||||||
|
## Docker Compose
|
||||||
|
|
||||||
|
Or simply run it via **docker-compose**:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
services:
|
||||||
|
bot:
|
||||||
|
restart: unless-stopped
|
||||||
|
image: git.0day.agency/wirehack7/novelai-bot:latest
|
||||||
|
environment:
|
||||||
|
- NOVELAI_API_TOKEN=
|
||||||
|
- DISCORD_BOT_TOKEN=
|
||||||
|
- DISCORD_CHANNEL_ID=
|
||||||
|
networks: {}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Notes
|
||||||
|
|
||||||
|
To create a Discord bot go to [Discord Developers](https://discord.com/developers/).
|
||||||
|
You should make the bot private.
|
||||||
@ -166,7 +166,7 @@ async def generate(
|
|||||||
timeout=120,
|
timeout=120,
|
||||||
)
|
)
|
||||||
duration = time.monotonic() - start_time
|
duration = time.monotonic() - start_time
|
||||||
logger.info("Bildgenerierung dauerte %.2f Sekunden", duration)
|
logger.info("Image creation took %.2f seconds", duration)
|
||||||
|
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
response_bytes = response.content
|
response_bytes = response.content
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user