Skip to content

Commit

Permalink
idea to image
Browse files Browse the repository at this point in the history
  • Loading branch information
Kye committed Oct 15, 2023
1 parent 491868f commit 08e9631
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dalle3/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from selenium.webdriver.support import expected_conditions as EC
from undetected_chromedriver import Chrome, ChromeOptions


# Main class
class Dalle:
"""
A class used to interact with the DALL-E 3 Unofficial API
Expand Down
2 changes: 1 addition & 1 deletion example.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from dalle3 import Dalle

# Define cookie using env or empty string
cookie = os.getenv("BING_COOKIE") or "1Dv1qGH6TcGzEQUJqU6AfxnMfxPR4V9yCtKk8ox2kpl-_YwmKzM9CnzPmlge158c0DTSDAEqrDV5itj3Ll0GyuaRrWmXf0Gk_2FIZuL2NvCLUrCF3VALngS9qw9vESZ9EY9vqVVVvjGoIJpxf9HEz6OV3fih4dw_Abc7GrfRC7p8iRDiCmotsgy9lPKf6sSPg9yy2lMTSU9-MNmkga0CACSZsV4La9NU5V5nNowUAMhU"
cookie = os.getenv("BING_COOKIE") or ""

# Set up logging
logging.basicConfig(level=logging.INFO)
Expand Down
6 changes: 5 additions & 1 deletion idea_to_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ def main():
llm = OpenAIChat(args.openai_api_key)
dalle = Dalle(args.cookie)

# Refine the prompt using the llm
image_to_generate = llm_prompt(args.image_to_generate)
refined_prompt = llm(image_to_generate)

# Open the website with your query
dalle.open_website(llm_prompt(args.image_to_generate))
dalle.open_website(refined_prompt)

# Get the image URLs
urls = dalle.get_urls()
Expand Down
4 changes: 2 additions & 2 deletions tests/dalle.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import pytest
import os
from unittest.mock import patch, MagicMock
from dalle3.main import Dalle
from dalle3 import Dalle

test_cookie = os.getenv("BING_COOKIE") or "1Dv1qGH6TcGzEQUJqU6AfxnMfxPR4V9yCtKk8ox2kpl-_YwmKzM9CnzPmlge158c0DTSDAEqrDV5itj3Ll0GyuaRrWmXf0Gk_2FIZuL2NvCLUrCF3VALngS9qw9vESZ9EY9vqVVVvjGoIJpxf9HEz6OV3fih4dw_Abc7GrfRC7p8iRDiCmotsgy9lPKf6sSPg9yy2lMTSU9-MNmkga0CACSZsV4La9NU5V5nNowUAMhU"
test_cookie = os.getenv("BING_COOKIE") or ""

@pytest.fixture
def dalle():
Expand Down

0 comments on commit 08e9631

Please sign in to comment.