https://github.com/dedinc/bingart
bingart is an unofficial API wrapper for Bing Image Creator (based on DALL-E 3). It allows you to programmatically generate AI-powered images using Bing's image creation tool.
https://github.com/dedinc/bingart
ai-art ai-art-generator ai-generated-images ai-generation bing-api bingart dall-e dall-e-3 dalle-3 dalle3
Last synced: 13 days ago
JSON representation
bingart is an unofficial API wrapper for Bing Image Creator (based on DALL-E 3). It allows you to programmatically generate AI-powered images using Bing's image creation tool.
- Host: GitHub
- URL: https://github.com/dedinc/bingart
- Owner: DedInc
- License: mit
- Created: 2023-12-03T03:40:02.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-07T04:07:45.000Z (about 2 months ago)
- Last Synced: 2025-04-09T21:15:01.978Z (13 days ago)
- Topics: ai-art, ai-art-generator, ai-generated-images, ai-generation, bing-api, bingart, dall-e, dall-e-3, dalle-3, dalle3
- Language: Python
- Homepage: https://pypi.org/project/bingart/
- Size: 9.77 KB
- Stars: 39
- Watchers: 1
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# 🎨 bingart
bingart is an unofficial 🤫 API wrapper for Bing Image Creator (based on DALL-E 3). It allows you to programmatically generate 🖼️ AI-powered images using Bing's image creation tool.
> ⚠️ **Warning:** The `_U` auth cookie should be changed every 2-4 weeks for working.
## 💡 Description
This module uses web scraping and engineering techniques to interface with Bing's internal image creation APIs. It is not an official API client.
### 🔑 Key Features
- 🖼️ **Generate images** by providing a text prompt
- 📸 **Get image URLs** up to 4 generated images
- 🔐 **Authentication** via saved Bing cookies or auto-fetched from browsers
- ⚠️ **Custom exceptions** for common issues## 💻 Usage
Import and instantiate the `BingArt` class with a valid `_U` cookie value:
```python
from bingart import BingArtbing_art = BingArt(auth_cookie_U='...')
try:
results = bing_art.generate_images('sunset')
print(results)
finally:
bing_art.close_session()
```### Sometimes an extra cookie called `KievRPSSecAuth` is required for it to work properly
```python
bing_art = BingArt(auth_cookie_U='...', auth_cookie_KievRPSSecAuth='...')
```### Also, you can try the auto cookie search feature
```python
bing_art = BingArt(auto=True)
```Call `generate_images()` with your query text:
```python
results = bing.generate_images("a cat painting in Picasso style")
```The return value contains image URLs and original prompt:
```json
{
"images": [
{"url": "https://..."}
],
"prompt": "a cat painting in Picasso style"
}
```## 🚨 Exceptions
- `AuthCookieError`: Invalid authentication cookie
- `PromptRejectedError`: Prompt rejected as unethical## 🤝 Contributing
Pull requests welcome! Please open an issue to discuss major changes.