Refeshop > Service > Ai Tools >
GPT-4 Coding Tutorial: How to Build and Promote My Midjourne
时间:2024-05-29 10:32
来源 :Refeshop

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:

  1. Download the compressed package and extract it.

  2. 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.

  3. 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

  4. Go to the Chrome browser's extensions page and enable developer mode.

  5. Select "Load unpacked" to load the extension.

  6. 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

  • Organize your requirements and goals beforehand, preferably writing them down before pasting them in. Don't be lazy; if you are, GPT will teach you a lesson, especially for complex tasks.
  • Assign different roles and processes to GPT as if it were a software development team. For example, have it output the overall architecture first and then go to another chat to output specific code, even separating the front-end and back-end, and outputting each module separately.
  • Provide detailed descriptions of the requirements, including the background, desired implementation methods, any external software integrations, and how different content interacts.
  • Specify the expected output results, including the content and requirements, primarily clarifying what GPT needs to produce.
  • Clarify your requirements for the content, including explanations for each solution choice, relevant documentation, code structure, and comments for each key code structure.

Optimization and Adjustment

  • If issues arise frequently during communication, consider the following:
    • Implement one module or feature at a time to gradually advance the project, reducing complexity.
    • When the output results frequently have issues, revisit the information you provided, checking for any incomplete or ambiguous descriptions.
    • Seek additional information from other sources, such as asking GPT for official documentation links.
    • If GPT's memory of previous content seems faulty, resync the current content with GPT completely.

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

展开

24*7 Live Chat

  • Chat 1
  • Chat 2
  • Chat 3
  • Join our community
  • Chat4send message to me
  • QQ:95388812