GithubHelp home page GithubHelp logo

useapi / midjourney-api-client Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 47 KB

Python client library for Midjourney API by useapi.net

Home Page: https://useapi.net

Python 100.00%
ai api integration midjourney openapi

midjourney-api-client's Issues

Button U3 not found in job exception

Any clue why I am getting following error ?

2024-03-26T20:40:19CET: https://cdn.discordapp.com/attachments/1222206121834582160/1222265765936500796/miroslavvranka_Photo_selfie_of_45-year-old_American_male_ce57b1e7-311c-4a4b-9b84-d8b3a66ac831.png?ex=661596b3&is=660321b3&hm=7161effc3d59197774d4b6e43de5ec56b6007c45aabc5dc4e98b6ece9baaaca1& url
2024-03-26T20:40:19CET: buttons ['U1', 'U2', 'U3', 'U4', '๐Ÿ”„', 'V1', 'V2', 'V3', 'V4'] buttons
2024-03-26T20:40:20CET: Exception when calling jobs_button_post: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Date': 'Tue, 26 Mar 2024 19:40:20 GMT', 'Content-Type': 'application/json', 'Content-Length': '117', 'Connection': 'keep-alive', 'Report-To': '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v4?s=AR%2FMmnXmHEF2sPfke3Iu6nbid12k902FGaWkJLtgVmaseryacvpkeZZBCLEz6EpR8yLI1%2BUB%2BqW93YW4zRCSUlA0NfV%2BxxNjkahbZrJAfGbgkXA9ZZhhZ72zX%2F27cBUphQ%3D%3D"}],"group":"cf-nel","max_age":604800}', 'NEL': '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}', 'Vary': 'Accept-Encoding', 'Server': 'cloudflare', 'CF-RAY': '86a99c9edb230a69-AMS', 'alt-svc': 'h3=":443"; ma=86400'})
HTTP response body: {"error":"Button U3 not found in job ***************** buttons ","code":400}

when I am running imagine + command fnc in attached process_prompts() below in 2 threads ?

def process_prompts(prompts_df):
    df = pandas.read_csv(prompts_df)
    random_digit = random.choice([i for i in range(1, 7)])
    random_command = random.choice([f"U{i}" for i in range(1, 5)])

    for index, row in df.iterrows():
        log_api.info(f"triggered prompt >>> {row['Prompt']} <<")

        mjc.imagine_command(row['Prompt'])
        try:
            mjc.button_command(random_command)
        except ValidationError as ve:
            log_api.error(f"Validation error occurred: {ve}")
        except Exception as e:
            log_api.error(f"An unexpected error occurred: {e}")

        df.at[index, 'PromptCalled'] = True

        log_api.info(f"prompt >>> {row['Prompt']} << is done! ")
        time.sleep(random_digit)

if __name__ == "__main__":
    prompts_df = [prompts_1, prompts_2]
    with ThreadPoolExecutor(max_workers=2) as executor:
        resp = executor.map(process_prompts, prompts_df)

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.