Skip to content

Python webscrapper and wrapper for Bing Image Creator. Educational purposes intended. Windows only.

License

Notifications You must be signed in to change notification settings

beratcmn/bing-image-creator-cli

Repository files navigation

banner

Bing Image Creator Tool

Description: Bing Image Creator Tool is a tool that allows you to run Bing Image Creator (I'll call it BIC) from your terminal. Due to Windows' limitations I wasn't able to create a Virtual Display such as Xvfb or Xvnc provided by PyVirtualDesktop. That's why in this project I use pyvda to create virtual desktops in Windows 10/11.

Why not use the --headless mode?: I've tried to use the headless mode but Bing refused to run any scripts while the browser is headless. This error is consistent in both Chrome and Edge. Firefox requires further testing.

Other things to include:

  • Technology stack: Two main python libraries has been used. Selenium for webscrapping and pyvda for managing desktops and windows.
  • Status: I was trying to use BIC with AutoGPT so I had to create a basic template for my needs. This is a very early version to give a designated version number.

Changelog [19.03.2024]

  • pyvda updated to 0.4.1 to work up to Windows 11 OS Build 22631.3296
  • MS Edge Driver updated to 122.0.2365.92
  • Added a selector for initial input box.
  • Bing Image Creator XPaths updated to work with 'Microsoft Designer' so it should work fine now.
  • Fixed the timeout issue for 'Non-Boosted' images.
  • Fixed the Cookie Popup issue.
  • Fix issue causuing downloading the second image instead of first too.

Known Issues

  • So far only works with Microsoft Edge because of Auto Login feature.
  • Less than 4 images are causing the tool to crash.
  • Content Policy Error, I'll fix this issue in the next update.

Example

video-0.mp4

Screenshot

banner

Image grid example

banner


Installation

To install the program run the following script

install.bat

Alternatively you can run following commands from the root of your project's directory:

git clone https://github.com/beratcmn/bing-image-creator-cli.git
cd bing-image-creator-cli
python -m venv .venv
.venv\Scripts\activate.ps1
pip install -r requirements.txt

Usage

After installing the required libraries, you can run the tool by using the run.bat file.

run.bat

You can also run the tool by running the following command in your terminal:

python src/main.py

I highly recommend you to use Microsoft Edge because it will automatically login to your Microsoft account thus removing the need to login besides it's the only browser that I've tested and it works perfectly.

Todo

  • Create dataset for Magic Prompt Feature.

    beratcmn/magic-prompt

  • Add Magic Prompt feature to the tool like in Ideogram.

    What is Magic Prompt? Magic Prompt interprets your original prompt according to your instructions and optimizes it to maximize the variety and beauty of the images generated. This feature also allows you to write your prompts in your native language for greater accuracy and ease of use by users worldwide.

  • Add a CLI for the tool.

  • Add a simple REST API for the tool.

About

Python webscrapper and wrapper for Bing Image Creator. Educational purposes intended. Windows only.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published