The DALL-E 3 Unofficial API is a Python script that allows you to interact with the DALL-E 3 AI image generator app, enabling you to search for and download images created by the model.
Before using the DALL-E 3 Unofficial API, ensure you have the following prerequisites set up:
- Python 3.x
- Required Python packages:
undetected_chromedriver
,selenium
,requests
To install the required packages, run:
pip install undetected-chromedriver selenium requests
You should obtain your cookie to run this program. You can follow these steps to obtain your cookie:
-
Go to Bing Image Creator in your browser and log in to your account.
-
Then press
Ctrl+Shift+J
to open developer tools. -
Navigate to the Application section.
-
Click on Cookies section.
-
Find variable
_U
and copy it's value.
Paste this value in the code.
To utilize the DALL-E 3 Unofficial API, follow these steps:
- Clone the repository or download the repo to your local machine.
git clone https://github.com/Weyaxi/Dalle-3-Unoffical-API
- Open a terminal or command prompt and navigate to the script's directory:
cd Dalle-3-Unoffical-API
- Run the script
dalle3_arg.py
with a query or queries as an argument to download the generated images:
python3 dalle3_arg.py "your_search_query" "your_search_query_2"
The DALL-E 3 Unofficial API provides the following functionality:,
- The script opens the Bing Image Creator (DALL-E 3) in a headless Chrome browser.
- It adds a cookie to bypass any automation detection.
- Searches for images based on the provided query.
- Extracts and downloads image URLs.
The script will create a timestamped folder in the specified directory (usually the current working directory) containing downloaded images. The images will be named with the format "query (index).png." Additionally, the script logs information about the process.
You can look at this too:
query/
├─ 10-10-2023 12-24-03/
│ ├─ query (1).png
│ ├─ query (2).png
│ ├─ query (3).png
│ ├─ query (4).png
Please note that this is an unofficial API and may be subject to changes on the target website. Use it responsibly.