The latest Ai system ChatGPT program source code + make pictures from pictures + Dall-E2 painting + support GPT4 + Midjourney painting

1. AI creation system

SparkAi creation system is an Ai intelligent question and answer system and Midjourney painting system developed based on OpenAI’s popular ChatGPT. It supports the full model of OpenAI-GPT + the full model of domestic AI. The overall test of the source code system in this issue is very perfect. It can be said that SparkAi is currently the only domestic ChatGPT docking OpenAI software system. So how to build and deploy AI creation ChatGPT? Let me write a detailed graphic tutorial here! The SparkAi program uses Nestjs and Vue3 framework technology to continuously integrate AI capabilities into the AIGC system. Already supports OpenAI GPT full model + domestic AI full model + painting pool system.

“SparkAi system details and construction and deployment documents”:

SparkAi system documentation SparkAi system documentation https://www.yuque.com/yuqueyonghutq9yt2/egy0d0?#

AI model questions

AI Painting

Added Midjourney partial redrawing (Vary Region) online editing function

Mobile version

1.1 Core functions of the program

Already supports OpenAI GPT full model + domestic AI full model + painting pool system!

  1. AI questioning: The program has supported GPT3.5, GPT4.0 questioning, OpenAIGPT full model + domestic AI full model, and supports GPT online questioning

  2. Already supports OpenAIGPT full model + domestic AI full model, has supported domestic AI model Baidu Wenxin Yiyan, supports Baidu Wenxin 4.0 version, Microsoft Azure, Alibaba Cloud Tongyi Qianwen model, Tsinghua Zhipu AIChatGLM, iFlytek Spark Models, etc., newly support iFlytek Spark Cognitive Large Model V3.0, and newly support Tencent Hunyuan Large Model

  3. AI painting: Midjourney painting (fully customized parameter adjustment), Midjourney drawing from pictures, Dall-E2 painting

  4. Added Midjourney painting account pool system, which can achieve high concurrency for tens of thousands of users

  5. Support Midjourney partial redrawing (Vary Region)

  6. WeChat official account + email + mobile number registration and login

  7. One-click intelligent mind map generation

  8. The application square knowledge base supports users to customize the front desk to add private or shared information.

  9. AI Painting Square (Gallery)

  10. Invitation + agent distribution model

  11. User daily check-in function

  12. Session records are saved synchronously

  13. Supports docking with WeChat official payment, Yipay, code payment, Hupijiao payment, etc.

  14. Other core features

1.2 Change Log

SparkAi latest major version update log:

SparkAi [V3.0] version is now online!

【V3.1.0】Update function (10.29 update):

1. Added Midjourney partial redrawing (Vary Region) online editing function

2. Added Midjourney painting account pool system, which can achieve high concurrency for tens of thousands of users

3. Support Midjourney partial redrawing function on mobile phone (Vary Region partial redrawing)

4. Home page AI question UI update, sidebar style update, dialog tool update

5. Question model: Added support for Tencent Hunyuan large model

6. Question model: Added support for iFlytek Spark Cognitive Large Model V3.0 (comments released in 20231024 surpass GPT)

7. Question model: Added support for Baidu Wenxin version 4.0 (compared to OpenAI-GPT4.0)

8. Remove the background Midjourney painting proxy configuration and transfer it to the painting pool for processing to optimize speed.

9. Fixed the problem of U1-4 appearing in a single picture of MJ painting and the problem of being unable to operate a single picture.

10. The user-side large model list is allowed to close automatically after clicking to switch, and the list supports sliding selection for viewing.

11. Fixed the issue where when Baidu sensitive word detection is turned on, because the prompt word to generate a picture from a picture contains the image link address, Baidu detects the sensitive word that triggers the promotion, resulting in the inability to submit the drawing.

2. System demonstration

Demonstration system

SparkAi official demo site:
https://ai .sparkaigf.com
Management backend:

https://ai.sparkaigf.com/sparkai/admin

Test account: admin, 123456

If you cannot access, please check “SparkAi System Details and Construction and Deployment Documents” to get the latest address.

3. System function module

3.1 ChatGPT model questions

Support GPT online questions

3.2 Prompt application

3.2.1 Prompt application

3.2.2 Custom Prompt application

Support user-defined Prompt applications

3.3 Support Midjourney painting

  • Supports synchronized official image regeneration instructions

  • Synchronize the official Vary command to enhance the contrast of a single image Vary(Strong) | Vary(Subtle)

  • Synchronize with the official Zoom command to infinitely zoom a single picture Zoom out 2x | Zoom out 1.5x

  • Added Midjourney partial redraw (Vary Region) online editing function

Vincent Pictures

Use pictures to create pictures

3.4 Dall-E2 painting (removed)

3.5 Mind map generation

3.6 AI Gallery

There are too many functions in other and backend pages, so they will not be displayed. Directly visit the demo site and demo backend!

4. Build and deploy tutorial

The following tutorial is built using the pagoda panel

4.1 Basic env environment configuration

In the code, we provide the basic environment variable file configuration file env.example . Before using it, remove the suffix and change it to the .env file. We only need The following things need to be configured.

  • Authorization code authorization ip configuration

  • Mail service configuration

  • mysql database These three items are basic configurations. Mysql and authorization are necessary. Only when mysql and authorization are configured can the project be started successfully. The mail service can be added later.

4.2 env file code

# Server ip
SPARK_AI_HOST=
# Authorization code
SPARK_AI_KEY=

# mysql
DB_HOST=localhost
DB_PORT=3306
DB_USER=database username
DB_PASS=database password
DB_DATABASE=database name
DB_LOG=false
DB_SYNC=true

# mailer mail service
MAILER_HOST=smtp.163.com
MAILER_PORT=465
MAILER_USER=Sending email address
MAILER_PASS=Mailbox sending key
MAILER_FROM=Sending email address

#Redis
REDIS_PORT=6379
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=

# jwt token
JWT_SECRET=chat-spark
# jwt token expiration time
JWT_EXPIRESIN=7d
# Interface document prefix
SWAGGERPREFIX=/docs
# Custom port
PORT=9520

5. Environment installation

Preconditions:

  1. Domestic or overseas servers are available. The minimum configuration is 2H2G. It is recommended to 2H4G or even higher.

  2. Pagoda installed successfully

Required environment:

  • Nginx >= 1.19.8

  • MySQL >= 5.7 or MySQL 8.0

  • PHP-7.4 (optional)

  • PM2 Manager >=5.5

  • Redis 7.0.11

  • Node version: >=16.19.1

5.1 Node version

Use PM2 to switch Node versions (required)

  • Switch Node version to: v16.19.1

5.2 Install pnpm module

5.3 Install Redis

6. Deployment and running

6.1 Create a new site

Enter Pagoda -> Website -> Add site

6.2 Turn on HTTPS

6.2.1 Use your own ssl certificate

6.2.2 Let’s Encrypt certificate application

If you don’t have a certificate, use Pagoda’s free certificate and apply for Let’s Encrypt

6.3 Upload system source code

Delete the original files generated by the pagoda creation site

Upload and unzip the program to the root directory of the website

6.3.1 Configuration .env file

Double-click the .env.example file directly in the Pagoda to edit it, or edit it in the terminal vim

After the configuration is completed, delete the file suffix and the file name is .env

6.3.2 Check and verify Node environment

At this time, open the terminal again and determine whether we need a node-related environment.

node -v
npm -v
pnpm -v

6.4 Start the project

6.4.1 Open port

Pagoda panel securely opens 9520 port and 3306 port

6.4.2 Install dependencies

Use the terminal to switch to the website directory

cd /www/wwwroot/website directory

Or enter the ssh terminal directly in the root directory of the website

Use pnpm i command to install dependencies

pnpm i

6.4.3 Start the project

Start the project using the pnpm start command

pnpm start

6.4.4 View startup log

Enter pm2 log to view the detailed log. If you see the picture below, it means success!

pm2 log

6.4.5 Add reverse proxy

Add 9520 port reverse proxy. Pagoda Security needs to open this port, otherwise it will not be accessible.

7. Using the system

Deployment completed! Now you can access the system through the domain name

7.1 Management background

The default front-end address is the domain name address. The default back-end address is: https://domain name address/sparkai/admin

The default super administrator account is super, spark123

At this point we have completed the installation

7.2 Modify the default password of the super administrator

After logging in, please change the default password of the super administrator first.

7.3 Construction completed

8. Backend configuration & system version update

8.1 Background configuration

For system configuration tutorials and other tutorials, please go to the system details deployment document or the original blog tutorial.

8.2 system version update

For system version update tutorials, please go to the system details deployment document or the original tutorial on the blog.