Skip to main content

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

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bing_brush-0.1.2.tar.gz (4.4 MB view details)

Uploaded Source

Built Distribution

bing_brush-0.1.2-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file bing_brush-0.1.2.tar.gz.

File metadata

  • Download URL: bing_brush-0.1.2.tar.gz
  • Upload date:
  • Size: 4.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.17

File hashes

Hashes for bing_brush-0.1.2.tar.gz
Algorithm Hash digest
SHA256 42db9f7ad0748d69dcaeb7f1a1d63d58ea7c9ec3c8059037b67ec4f72e994c5f
MD5 3163bc3df01c2d9289edf6c44bc7a43a
BLAKE2b-256 0a10bbdc677c36181f294a000bbbc373bd0aa63f5b5bd44a738cda2fa0bf02d6

See more details on using hashes here.

File details

Details for the file bing_brush-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: bing_brush-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.17

File hashes

Hashes for bing_brush-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9991732f344a4f1b0cd5b5c94f0a56f46c570d46c358aadbc23e43ccfcd7efa2
MD5 2958ec32a1078cc5ab08d5aaadee770d
BLAKE2b-256 1c4ab6df4545203330d07429045b71a0e241ad95d2829dce87f08c332f453486

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page