Skip to main content

One-line Image Generating Program Based on the Bing Image Createor (Powered by DALL·E 3)


Credit: The solution of invoking Bing Image Creator API is from https://github.com/acheong08/BingImageCreator.

Installation

pip install bing_brush

Obtain your cookie

The cookie of Bing.com is needed. You need to login to Bing.com first, then follow the steps below to write your cookie to a file (e.g., cookie.txt):

Step0:

Vist https://www.bing.com/images/create

Step1:

Press F12 to open dev tools, then refresh the web page to run all requests again:

Select any rquest with type of xhr, then click the head of the request

Step2:

In the detail of the request header, find the Cookie section, copy the value of it to your file (e.g., cookie.txt)

Then your cookie for Bing.com has successfully be stored.

Usage

CLI

# -c is short for --cookie, -p is short for --prompt
bing_brush -c cookie.txt -p 'a cute panda eating bamboos' -o output_folder

This command will generate 4 pictures located in output_folder, example outputs:

Python API

brush = BingBrush(cookie='/path/to/cookie.txt')
brush.process(prompt='a cute panda eating bamboos', out_folder='output_folder')

TODO

  • unit test
  • support for obtaining cookie from os.env

Logo

Logo of this project is generated by Bing Image, prompt:

A minimalist logo vector image, square-shaped, with a magical brush implemented in Python language in the center, colorful, digitial art

Contribution

Metadata

Release files for bing-brush 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bing-brush 0.1.1
File Size Uploaded
bing_brush-0.1.1.tar.gz 4.4 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for bing-brush 0.1.1
File Interpreter ABI Platform
bing_brush-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 4.4 MB

Release files / bing_brush-0.1.1.tar.gz

Download URL bing_brush-0.1.1.tar.gz
Size 4.4 MB
Tags Source
SHA-256 checksum
How to use checksums
b4cdfd5ef6254a19e38d79ae3185316271abdd87aa5d2a4effe3002192a1f3c4
BLAKE2b-256 checksum
How to use checksums
66eafd5df4490c07615b2add49b3c31e49187b696f567c4ea63c6cd9d1a753d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.17

Release files / bing_brush-0.1.1-py3-none-any.whl

Download URL bing_brush-0.1.1-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
360fa3ff66496752bad3aa3e7241c9a8738a917c3e9694680000a1fac62491c9
BLAKE2b-256 checksum
How to use checksums
7e164bdbb39b17d137cb93b328172aa28daf1753cf2f7516b5dccd1c2e7cc2cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.17

Release history Release notifications | RSS feed

0.1.2

2 release files

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page