For people like me who are not proficient in English, a significant pain point while using Midjourney or Stable Diffusion is the translation of prompts. Since prompts can sometimes be very long, using conventional translation tools either requires translating each word individually or translating the entire passage as a whole, which can make it difficult for us to understand the structure of the prompt and replace certain parts.
That's why I came up with the idea of this plugin. It can automatically translate sections of prompts based on the original semantic segmentation by the prompt author. Additionally, since the automatically added translation text might make it cumbersome to select and copy the prompts using a mouse, I've also incorporated a quick copy button for convenience. Taking it a step further, the plugin can even enable one-click sending of prompts to the Discord input box.
The code for the plugin is now open-sour发ced, and you can download it here: https://github.com/op7418/Mijourney-enhanced
Here's how to use the plugin:
Download the compressed package and extract it.
Change the API KEY in the content_script.js
file to your own Google Translate API KEY. In the future, it will also support ChatGPT for translation.
You can find a tutorial on how to apply for a Google Translate API KEY here, with a monthly free quota of 500,000 characters, which should be sufficient for personal use. Application tutorial: https://bobtranslate.com/service/translate/google.html
Go to the Chrome browser's extensions page and enable developer mode.
Select "Load unpacked" to load the extension.
Once installed, the extension will automatically trigger on the Midjourney image detail page.
Summary and Tips Learned
I have also summarized some tips and key points based on my own experience and observations of others collaborating with GPT-4, covering both information input and optimization. If you don't want to read through the entire development process, you can refer to these points directly. However, it's still recommended to read the process for a deeper understanding.
Information Input
Optimization and Adjustment
Development Process
Here's a brief overview of the collaborative development process with GPT-4 and some key moments, including some pitfalls encountered. I originally intended to share the complete conversation, but it was too long and failed to upload.
Initially, I briefly described my needs to GPT, and it provided detailed steps and code, including asking clarifying questions, suggesting reviewing development documentation, and outlining the project's file structure and specific code for each file. However, this approach had its issues, and I recommend not following my initial approach.
After creating the necessary folders, files, and icons based on GPT's guidance and pasting the code, I began debugging the plugin in the browser. As expected, errors started to appear, and I repeatedly provided GPT with feedback on the errors to have it make corrections.
One good practice I followed was to implement one feature at a time. Initially, I asked GPT to translate the entire prompt, which was simpler and easier to troubleshoot.
During debugging, the simplicity of my initial prompt became a problem. I only told GPT to translate content from a specific webpage without specifying which webpage, leading to continuous errors. I eventually discovered the "matches": ["*://*.example.com/*"]
section in the manifest.json
file and asked GPT what it meant. It explained that I needed to replace it with the actual webpage address I wanted to target (I was quite frustrated at this point).
After making the necessary changes and providing additional information (such as the class name of the translation location), the translations successfully appeared after the prompts. This gave me some positive feedback and kept me from giving up.
Next, I asked GPT to separate the translations, placing them in different span
tags under the prompt's P
tags to achieve segmented translation. To aid understanding, I'm attaching the DOM structure of the relevant section on the Midjourney detail page.
GPT implemented this well, and the translations indeed appeared in separate span
tags. However, there was a minor issue where punctuation marks were also being translated. I asked GPT to filter out
Here comes the promotional video. Promotional videos are often more intuitive than pictures and textual descriptions, allowing for better outreach. I highly recommend using Screen Studio (https://www.screen.studio/) as a tool. It can automatically add stunning backgrounds and animations to your videos after recording. However, the subscription fee is quite steep, costing $89 per year. But if your product is not just a hobby project, it's a worthwhile investment. Alternatively, you can record your own videos and edit them simply with software like Jianying (Cut). In either case, having something is better than nothing.
Images
That's it for the content. Watching others code with GPT-4 may seem effortless, but after trying it myself, I realized it's not as easy as it seems. Nevertheless, I couldn't have written this plugin without prior systematic learning.
As you may have noticed, those who can articulate their needs clearly and understand basic coding logic will excel at using GPT-4 for product development. In this regard, it could be a fantastic opportunity for skilled product managers.
Ultimately, I encourage you to try and experiment. Reading predictions and analyses every day won't help you create a great product. Only through hands-on experience can you find the methods and processes that suit you best.
Moreover, the process of constantly interacting with GPT-4 is also a learning journey for yourself. Initially, I had no idea what it was writing, but through continuous communication, I've started to understand the code.
GPT-4 will not replace programmers; it will only enable more people to become programmers.
Thank you for reading this far. If you find my content helpful, please consider sharing it with your friends or colleagues.
We are a non-profit organization dedicated to providing the most comprehensive and authentic information about brokers to the public, free of charge. Our mission is to present the most genuine aspects of brokers and offer the best comparison tools to help you thoroughly evaluate each broker. We welcome and encourage every visitor to share their experiences with any broker.More
Important Reminder: Cryptocurrency trading involves risks and is not suitable for every investor. Buck Commission Rebate reminds all investors that cryptocurrency trading investments are risky, and you should be cautious when entering the market! Investment Services.