-
Notifications
You must be signed in to change notification settings - Fork 0
Create examples in JavaScript and Python for Midjourney API via Legnext #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #1
- Create midjourney-example.js with complete implementation - Add node-fetch dependency to package.json - Update .env.example with Legnext API credentials - Update README with Midjourney example instructions The example demonstrates: - Creating image generation jobs with text prompts - Polling for job completion with status tracking - Retrieving generated image URLs and available actions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Create midjourney_example.py with complete implementation - Add requests dependency to requirements.txt - Update .env.example with Legnext API credentials - Update README with Midjourney example instructions The example demonstrates: - Creating image generation jobs with text prompts - Polling for job completion with status tracking - Retrieving generated image URLs and available actions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Create workflow for JavaScript Midjourney example - Create workflow for Python Midjourney example - Both workflows are manually triggerable via workflow_dispatch - Support custom prompts as workflow inputs - Use repository secrets for API keys - Upload execution logs as artifacts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This reverts commit dc49fb0.
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
🔄 Auto-restart 1/3Detected uncommitted changes from previous run. Starting new session to review and commit them. Uncommitted files: Auto-restart will stop after changes are committed or after 2 more iterations. Please wait until working session will end and give your feedback. |
Added __pycache__/ and Python bytecode files (*.pyc, *.pyo, *.pyd) to prevent them from being tracked in the repository. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
Summary
This PR adds comprehensive examples for accessing the unofficial Midjourney API via Legnext in both JavaScript and Python, along with GitHub Actions workflows to run them manually.
Changes Made
JavaScript Example
examples/javascript/midjourney-example.jswith full implementationpackage.jsonwithnode-fetchdependency andmidjourneyscript.env.examplewith Legnext API credentialsPython Example
examples/python/midjourney_example.pywith full implementationrequirements.txtwithrequestsdependency.env.examplewith Legnext API credentialsGitHub Actions Workflows
.github/workflows/run-javascript-midjourney.ymlworkflow_dispatch.github/workflows/run-python-midjourney.ymlworkflow_dispatchAPI Documentation Reference
The implementation is based on the official Legnext API documentation:
https://api.legnext.ai/api/v1/diffusion(POST)/v1/job/{job_id}(GET)x-api-keyheaderHow to Use
JavaScript Example
Python Example
GitHub Actions
Navigate to the Actions tab and run either:
Note: You need to add
LEGNEXT_API_KEYto the repository secrets first.Testing
Closes
Fixes #1
🤖 Generated with Claude Code