Giter Club home page Giter Club logo

dalle3's People

Contributors

carden-code avatar dependabot[bot] avatar elder-plinius avatar kyegomez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dalle3's Issues

Simultaneous image generation

Hello, please tell me how the generation works now? Do I need to wait until 1 request is completed or can I generate several at the same time? If you open 2 tabs in the browser and write 2 different requests and send them at the same time, they will be executed.

cannot import name 'load_tool' from 'transformers' [BUG]

when running the script, to the line:
from dalle3 import Dalle
There is exception. detail as below:
Exception has occurred: ImportError
cannot import name 'load_tool' from 'transformers' (C:\Users\xx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\transformers_init_.py)
File "C:\Users\xx\Desktop\Dalle-3.py", line 3, in
from dalle3 import Dalle
ImportError: cannot import name 'load_tool' from 'transformers' (C:\Users\xx\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\transformers_init_.py)

InvalidArgumentException: Message: invalid argument: missing 'value'

When I use the Example code you provide:

`

import os
import logging
from dalle3 import Dalle

cookie = os.getenv("16OIrOlIoTP5fqH8GhswDQ67f_Q4T-hyBZwnVzlhEg8oZE4B2jVEwa1Sog9mis_8lVS_XM8KPRHOZuyePRHXm55-lOANcfivACBuuBaqQ29kRL_lxzM343TMR95c9Kr3gYylpyzgm41iUO4r3o0Rrowcw30XIgF9rYcthyWPW9Dw0azAmFSCgOJM7G07l9lA_EUdNvWn1spdHYI3arFbV4g")

logging.basicConfig(level=logging.INFO)

dalle = Dalle(cookie)

dalle.create(
"Fish hivemind swarm in light blue avatar anime in zen garden pond concept art anime art, happy fish, anime scenery"
)

urls = dalle.get_urls()`

It returns this message:

could not detect version_main.therefore, we are assuming it is chrome 108 or higher
Started executable: C:\Users\Isuch\appdata\roaming\undetected_chromedriver\undetected_chromedriver.exe in a child process with pid: 12564
POST http://localhost:52674/session {"capabilities": {"firstMatch": [{}], "alwaysMatch": {"browserName": "chrome", "pageLoadStrategy": "normal", "goog:chromeOptions": {"extensions": [], "binary": "C:\Program Files\Google\Chrome\Application\chrome.exe", "args": ["--disable-blink-features=AutomationControlled", "--remote-debugging-host=127.0.0.1", "--remote-debugging-port=52673", "--user-data-dir=C:\Users\IGNACI~1\AppData\Local\Temp\tmp9w7qfeaa", "--lang=es-ES", "--no-default-browser-check", "--no-first-run", "--no-sandbox", "--test-type", "--headless=new", "--window-size=1920,1080", "--start-maximized", "--no-sandbox", "--log-level=0"], "debuggerAddress": "127.0.0.1:52673"}}}}
Starting new HTTP connection (1): localhost:52674
http://localhost:52674/ "POST /session HTTP/1.1" 200 0
Remote response: status=200 | data={"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"118.0.5993.89","chrome":{"chromedriverVersion":"118.0.5993.70 (e52f33f30b91b4ddfad649acddc39ab570473b86-refs/branch-heads/5993@{#1216})"},"fedcm:accounts":true,"goog:chromeOptions":{"debuggerAddress":"127.0.0.1:52673"},"pageLoadStrategy":"normal","platformName":"","proxy":{},"setWindowRect":false,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify","webauthn:extension:credBlob":true,"webauthn:extension:largeBlob":true,"webauthn:extension:minPinLength":true,"webauthn:extension:prf":true,"webauthn:virtualAuthenticators":true},"sessionId":"db78f584ef599cf1edb53c83ab073138"}} | headers=HTTPHeaderDict({'Content-Length': '760', 'Content-Type': 'application/json; charset=utf-8', 'cache-control': 'no-cache'})
Finished Request
POST http://localhost:52674/session/db78f584ef599cf1edb53c83ab073138/execute/sync {"script": "return navigator.webdriver", "args": []}
http://localhost:52674/ "POST /session/db78f584ef599cf1edb53c83ab073138/execute/sync HTTP/1.1" 200 0
Remote response: status=200 | data={"value":false} | headers=HTTPHeaderDict({'Content-Length': '15', 'Content-Type': 'application/json; charset=utf-8', 'cache-control': 'no-cache'})
Finished Request
POST http://localhost:52674/session/db78f584ef599cf1edb53c83ab073138/url {"url": "https://www.bing.com/images/create?q=Fish hivemind swarm in light blue avatar anime in zen garden pond concept art anime art, happy fish, anime scenery"}
http://localhost:52674/ "POST /session/db78f584ef599cf1edb53c83ab073138/url HTTP/1.1" 200 0
Remote response: status=200 | data={"value":null} | headers=HTTPHeaderDict({'Content-Length': '14', 'Content-Type': 'application/json; charset=utf-8', 'cache-control': 'no-cache'})
Finished Request
[18/10/2023 10:50:52] Bing Image Creator (Dalle-3) Opened
POST http://localhost:52674/session/db78f584ef599cf1edb53c83ab073138/cookie {"cookie": {"name": "_U", "value": null}}
http://localhost:52674/ "POST /session/db78f584ef599cf1edb53c83ab073138/cookie HTTP/1.1" 400 0
Remote response: status=400 | data={"value":{"error":"invalid argument","message":"invalid argument: missing 'value'\n (Session info: chrome=118.0.5993.89)","stacktrace":"\tGetHandleVerifier [0x002C4DE3+43907]\n\t(No symbol) [0x00250741]\n\t(No symbol) [0x001433ED]\n\t(No symbol) [0x001B276B]\n\t(No symbol) [0x00192B5C]\n\t(No symbol) [0x001A55CA]\n\t(No symbol) [0x00192956]\n\t(No symbol) [0x0016E17E]\n\t(No symbol) [0x0016F32D]\n\tGetHandleVerifier [0x00575AF9+2865305]\n\tGetHandleVerifier [0x005BE78B+3163435]\n\tGetHandleVerifier [0x005B8441+3138017]\n\tGetHandleVerifier [0x0034E0F0+605840]\n\t(No symbol) [0x0025A64C]\n\t(No symbol) [0x00256638]\n\t(No symbol) [0x0025675F]\n\t(No symbol) [0x00248DB7]\n\tBaseThreadInitThunk [0x76BBFCC9+25]\n\tRtlGetAppContainerNamedObjectPath [0x77BA7C6E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77BA7C3E+238]\n\t(No symbol) [0x00000000]\n"}} | headers=HTTPHeaderDict({'Content-Length': '858', 'Content-Type': 'application/json; charset=utf-8', 'cache-control': 'no-cache'})
Finished Request

InvalidArgumentException Traceback (most recent call last)
Cell In[6], line 16
13 dalle = Dalle(cookie)
15 # Open the website with your query
---> 16 dalle.create(
17 "Fish hivemind swarm in light blue avatar anime in zen garden pond concept art anime art, happy fish, anime scenery"
18 )
20 # Get the image URLs
21 urls = dalle.get_urls()

File C:\Anaconda\envs\Dalle\Lib\site-packages\dalle3\dalle.py:111, in Dalle.create(self, query)
108 self.driver.get(f"https://www.bing.com/images/create?q={query}")
109 logging.info(f"{self.get_time()} Bing Image Creator (Dalle-3) Opened")
--> 111 self.driver.add_cookie(cookie)
112 self.driver.refresh()
113 logging.info(f"{self.get_time()} Cookie values added ")

File C:\Anaconda\envs\Dalle\Lib\site-packages\selenium\webdriver\remote\webdriver.py:633, in WebDriver.add_cookie(self, cookie_dict)
631 self.execute(Command.ADD_COOKIE, {"cookie": cookie_dict})
632 else:
--> 633 self.execute(Command.ADD_COOKIE, {"cookie": cookie_dict})

File C:\Anaconda\envs\Dalle\Lib\site-packages\selenium\webdriver\remote\webdriver.py:344, in WebDriver.execute(self, driver_command, params)
342 response = self.command_executor.execute(driver_command, params)
343 if response:
--> 344 self.error_handler.check_response(response)
345 response["value"] = self._unwrap_value(response.get("value", None))
346 return response

File C:\Anaconda\envs\Dalle\Lib\site-packages\selenium\webdriver\remote\errorhandler.py:229, in ErrorHandler.check_response(self, response)
227 alert_text = value["alert"].get("text")
228 raise exception_class(message, screen, stacktrace, alert_text) # type: ignore[call-arg] # mypy is not smart enough here
--> 229 raise exception_class(message, screen, stacktrace)

InvalidArgumentException: Message: invalid argument: missing 'value'
(Session info: chrome=118.0.5993.89)
Stacktrace:
GetHandleVerifier [0x002C4DE3+43907]
(No symbol) [0x00250741]
(No symbol) [0x001433ED]
(No symbol) [0x001B276B]
(No symbol) [0x00192B5C]
(No symbol) [0x001A55CA]
(No symbol) [0x00192956]
(No symbol) [0x0016E17E]
(No symbol) [0x0016F32D]
GetHandleVerifier [0x00575AF9+2865305]
GetHandleVerifier [0x005BE78B+3163435]
GetHandleVerifier [0x005B8441+3138017]
GetHandleVerifier [0x0034E0F0+605840]
(No symbol) [0x0025A64C]
(No symbol) [0x00256638]
(No symbol) [0x0025675F]
(No symbol) [0x00248DB7]
BaseThreadInitThunk [0x76BBFCC9+25]
RtlGetAppContainerNamedObjectPath [0x77BA7C6E+286]
RtlGetAppContainerNamedObjectPath [0x77BA7C3E+238]
(No symbol) [0x00000000]

TOS

is this against the TOS, and will they ban accounts for this? You should let people know ahead of time, that this is not an "unofficial api", this is literally a webscraper.

from: https://www.microsoft.com/en-us/servicesagreement
"ii. Extracting Data. Unless explicitly permitted, you may not use web scraping, web harvesting, or web data extraction methods to extract data from the AI services."

TypeError

an error is constantly coming out - "TypeError: Binary Location Must be a String"

[BUG]

Describe the bug
What am I doing wrong?
To Reproduce
Steps to reproduce the behavior:

import os
import logging
from dalle3 import Dalle
Traceback (most recent call last):
File "", line 1, in
File "/opt/homebrew/lib/python3.11/site-packages/dalle3/init.py", line 2, in
from dalle3.idea2image import Idea2Image
File "/opt/homebrew/lib/python3.11/site-packages/dalle3/idea2image.py", line 5, in
from swarms.models import OpenAIChat
File "/opt/homebrew/lib/python3.11/site-packages/swarms/init.py", line 13, in
from swarms.swarms.orchestrate import Orchestrator
File "/opt/homebrew/lib/python3.11/site-packages/swarms/swarms/init.py", line 3, in
from swarms.swarms.dialogue_simulator import DialogueSimulator
File "/opt/homebrew/lib/python3.11/site-packages/swarms/swarms/dialogue_simulator.py", line 2, in
from swarms.workers.worker import Worker
File "/opt/homebrew/lib/python3.11/site-packages/swarms/workers/init.py", line 1, in
from swarms.workers.worker import Worker
File "/opt/homebrew/lib/python3.11/site-packages/swarms/workers/worker.py", line 13, in
from swarms.tools.autogpt import (
File "/opt/homebrew/lib/python3.11/site-packages/swarms/tools/autogpt.py", line 6, in
import pandas as pd
ModuleNotFoundError: No module named 'pandas'

[BUG] NFO:undetected_chromedriver.patcher:patching driver executable /Users/abcd/Library/Application Support/undetected_chromedriver/undetected_chromedriver INFO:root:[21/10/2023 01:11:24] Bing Image Creator (Dalle-3) Opened INFO:root:[21/10/2023 01:11:24] Cookie values added

Describe the bug
Getting this error:INFO:undetected_chromedriver.patcher:patching driver executable /Users/abcd/Library/Application Support/undetected_chromedriver/undetected_chromedriver
INFO:root:[21/10/2023 01:11:24] Bing Image Creator (Dalle-3) Opened
INFO:root:[21/10/2023 01:11:24] Cookie values added
To Reproduce
When executing the example script from the readme I get the error:
Getting this error:INFO:undetected_chromedriver.patcher:patching driver executable /Users/abcd/Library/Application Support/undetected_chromedriver/undetected_chromedriver
INFO:root:[21/10/2023 01:11:24] Bing Image Creator (Dalle-3) Opened
INFO:root:[21/10/2023 01:11:24] Cookie values added

[ERR0R]

i have already pasted mybig cookie still error

TypeError Traceback (most recent call last)
in <cell line: 13>()
11
12 # Instantiate the Dalle class with your cookie value
---> 13 dalle = Dalle(cookie)
14
15 # Open the website with your query

2 frames
/usr/local/lib/python3.10/dist-packages/selenium/webdriver/chromium/options.py in binary_location(self, value)
50 """
51 if not isinstance(value, str):
---> 52 raise TypeError(self.BINARY_LOCATION_ERROR)
53 self._binary_location = value
54

TypeError: Binary Location Must be a String

I always get this error: "TypeError: Binary Location Must be a String"

I have written this code after the example in this repo:

cookie = "i pasted here the _U cookie"
dalle = Dalle(cookie)
dalle.create("apple")
urls = dalle.get_urls()
dalle.download(urls, "images/")

When I run this code, I get the following error:

TypeError: Binary Location Must be a String

The problem is with the dalle = Dalle(cookie) line.

The fix for this is probably easy, but I just can't figure it out.

[BUG]

Describe the bug
Getting a cannot import name 'Dalle3' from 'dalle3' (D:_activeDev\dalle32.venv\Lib\site-packages\dalle3_init_.py)

To Reproduce
Steps to reproduce the behavior:
create a folder
install venv virtual environment
pip install python-dotenv, dalle3
Copy the initial code example.
Bug will display
maybe something to do with venv and the file structure?

[BUG] Bing image creator change the query url

Thanks very much for the great work.
It seems now Bing image creator change the query url from "https://www.bing.com/images/create?q=XXXXX" to https://www.bing.com/images/create?q=A%20fish%20is%20fishing%20a%20human&rt=4&FORM=GENCRE&id=6543ae2527e145a3895ad3cfd7612d33
and
https://www.bing.com/images/create/a-fish-is-fishing-a-human/6543ae2527e145a3895ad3cfd7612d33?FORM=GENCRE
This id seems different in each queries.
Could you help me to fix this issue?
image

[BUG] CRITICAL:root:Error while extracting image urls...

I ran the supplied simple example with my _U cookie and get this error:

CRITICAL:root:Error while extracting image urls. Maybe something is wrong about your prompt. (You can check you prompt manually)

Does this still work for other people?

Specify chrome driver version

Is your feature request related to a problem? Please describe.
Github action environment doesnot support latest chrome driver version 118.

Error message:

This version of ChromeDriver only supports Chrome version 118\nCurrent browser version is 117.0.5938.0

Describe the solution you'd like
Maybe add a parameter to Dalle object or provide someway(environment variables) to manually assign version of chrome drive. Which eventually goes to undetected_chromedriver.Chrome.

   import undetected_chromedriver as uc
   driver = uc.Chrome( version_main = 95 )

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.