Merge branch '108' of https://github.com/HBAI-Ltd/Toonflow-app into 108
22
Dockerfile
Normal file
@ -0,0 +1,22 @@
|
||||
FROM node:24-bookworm-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN npm config set registry https://registry.npmmirror.com/ && \
|
||||
yarn config set registry https://registry.npmmirror.com/
|
||||
|
||||
# Copy the repository contents into the image and install all dependencies
|
||||
COPY . .
|
||||
|
||||
# The container only runs the backend dev server, so strip Electron-only
|
||||
# packages before installing to avoid downloading desktop binaries.
|
||||
RUN node -e "const fs=require('fs');const pkg=JSON.parse(fs.readFileSync('package.json','utf8'));for(const section of ['dependencies','devDependencies']){if(!pkg[section]) continue;for(const name of ['custom-electron-titlebar','electron','electron-builder','electron-rebuild','electronmon']) delete pkg[section][name];}fs.writeFileSync('package.json', JSON.stringify(pkg, null, 2)+'\n');" && \
|
||||
yarn install --frozen-lockfile && \
|
||||
yarn cache clean
|
||||
|
||||
ENV NODE_ENV=dev
|
||||
ENV PORT=10588
|
||||
|
||||
EXPOSE 10588
|
||||
|
||||
CMD ["yarn", "dev"]
|
||||
894
LICENSE
@ -1,661 +1,259 @@
|
||||
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing under
|
||||
this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your version
|
||||
supports such interaction) an opportunity to receive the Corresponding
|
||||
Source of your version by providing access to the Corresponding Source
|
||||
from a network server at no charge, through some standard or customary
|
||||
means of facilitating copying of software. This Corresponding Source
|
||||
shall include the Corresponding Source for any work covered by version 3
|
||||
of the GNU General Public License that is incorporated pursuant to the
|
||||
following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU Affero General Public License from time to time. Such new versions
|
||||
will be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
---
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
## 补充协议 | Supplementary Agreement
|
||||
|
||||
If your software can interact with users remotely through a computer
|
||||
network, you should also make sure that it provides a way for users to
|
||||
get its source. For example, if your program is a web application, its
|
||||
interface could display a "Source" link that leads users to an archive
|
||||
of the code. There are many ways you could offer source, and different
|
||||
solutions will be better for different programs; see section 13 for the
|
||||
specific requirements.
|
||||
> **补充协议 | Supplementary Agreement**
|
||||
>
|
||||
> 若您将本软件或其衍生版本以产品形式分发、销售或提供给**两个及以上独立的第三方主体**使用(无论采用买断、订阅、授权或任何其他商业模式),均须事先取得 HBAI-Ltd 的**书面商业授权**。
|
||||
>
|
||||
> If you distribute, sell, or provide this software (or any derivative) as a product to **two or more independent third parties** (regardless of business model: one-time purchase, subscription, licensing, etc.), you must obtain **written commercial authorization** from HBAI-Ltd prior to such use.
|
||||
>
|
||||
> **五个以内(含五个)**的法人主体作为联合运营方共同使用本软件,且不向联合体以外的第三方分发或提供服务的,视为**内部使用,无需商业授权**。
|
||||
>
|
||||
> **Five (5) or fewer** legal entities jointly operating and using this software internally, without distributing or providing services to parties outside the joint operation, are considered **internal use** and do not require commercial authorization.
|
||||
>
|
||||
> 在使用 Toonflow 的过程中,您不得删除或修改 Toonflow 控制台或应用程序中的标识或版权信息。
|
||||
>
|
||||
> You may not remove or modify any trademarks, logos, or copyright notices in the Toonflow console or application.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
---
|
||||
|
||||
## 永久免费场景 | Always Free — No Authorization Required
|
||||
|
||||
以下使用场景**永久免费**,无需任何授权:
|
||||
|
||||
The following uses are **always free** and require no authorization:
|
||||
|
||||
- ✅ 用 Toonflow 制作内容,在平台发布并获得分账 / Using Toonflow to produce content and earn platform revenue shares
|
||||
- ✅ 二次开发,供自己团队内部使用 / Secondary development and modification for internal team use
|
||||
- ✅ ≤ 5 个法人联合运营内部使用,不对外提供服务 / ≤5 legal entities operating jointly, internally only
|
||||
- ✅ 个人学习、研究、非商业用途 / Personal learning, research, and non-commercial purposes
|
||||
|
||||
---
|
||||
|
||||
## 授权定价 | Licensing Pricing
|
||||
|
||||
商业授权费用与被授权方业务规模挂钩:
|
||||
|
||||
Commercial licensing fees scale with the licensee's business scale:
|
||||
|
||||
| 阶段 | 年销售额 | 年费 |
|
||||
|------|---------|------|
|
||||
| 🌱 扶持期 / Nurture | < ¥10 万 / $10k | **免费 / Free** |
|
||||
| 🚀 初创期 / Startup | ¥10–50 万 / $10k–$50k | ¥5,000 / 年 / year |
|
||||
| 📈 成长期 / Growth | ¥50–150 万 / $50k–$150k | ¥20,000 / 年 / year |
|
||||
| 🏢 规模期 / Scale | ¥150–500 万 / $150k–$500k | ¥80,000 / 年 / year |
|
||||
| 🌐 企业级 / Enterprise | > ¥500 万 / $500k | 面议 / Negotiable |
|
||||
|
||||
---
|
||||
|
||||
## AGPL 用户保护条款 | AGPL User Protection
|
||||
|
||||
> **不追溯条款 | Non-Retroactivity Clause**
|
||||
>
|
||||
> 本协议变更生效日期(v1.0.8 正式发布日)前,基于 AGPL-3.0 条款使用 Toonflow 的用户,其现有使用行为不受本协议变更的约束,继续按 AGPL-3.0 条款执行。
|
||||
>
|
||||
> Users who used Toonflow under AGPL-3.0 prior to the effective date of this change (v1.0.8 official release date) are not affected by this license change. Their existing usage continues under AGPL-3.0.
|
||||
270
README.md
@ -6,11 +6,21 @@
|
||||
<a href="https://gitee.com/HBAI-Ltd/Toonflow-app">
|
||||
<img src="https://img.shields.io/badge/Gitee-C71D23?style=flat-square&logo=gitee&logoColor=white" alt="Gitee" />
|
||||
</a>
|
||||
|
|
||||
<a href="https://gitcode.com/HBAI-Ltd/Toonflow-app">
|
||||
<img src="./docs/atomgitLogo.png" alt="Atomgit" style="height:16px"/>
|
||||
Atomgit
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<strong>中文</strong> |
|
||||
<a href="./docs/README.en.md">English</a>
|
||||
<strong>简体中文</strong> |
|
||||
<a href="./docs/README.zhtw.md">繁體中文</a> |
|
||||
<a href="./docs/README.en.md">English</a> |
|
||||
<a href="./docs/README.th.md">ไทย</a> |
|
||||
<a href="./docs/README.vi.md">Tiếng Việt</a> |
|
||||
<a href="./docs/README.ja.md">日本語</a> |
|
||||
<a href="./docs/README.ru.md">Русский</a>
|
||||
</p>
|
||||
|
||||
<div align="center">
|
||||
@ -32,8 +42,8 @@
|
||||
<a href="https://github.com/HBAI-Ltd/Toonflow-app/stargazers">
|
||||
<img src="https://img.shields.io/github/stars/HBAI-Ltd/Toonflow-app?style=for-the-badge&logo=github" alt="Stars Badge" />
|
||||
</a>
|
||||
<a href="https://www.gnu.org/licenses/agpl-3.0" target="_blank">
|
||||
<img src="https://img.shields.io/badge/License-AGPL-blue.svg?style=for-the-badge" alt="AGPL License Badge" />
|
||||
<a href="https://www.apache.org/licenses/LICENSE-2.0" target="_blank">
|
||||
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=for-the-badge" alt="Apache-2.0 License Badge" />
|
||||
</a>
|
||||
<a href="https://github.com/HBAI-Ltd/Toonflow-app/releases">
|
||||
<img alt="release" src="https://img.shields.io/github/v/release/HBAI-Ltd/Toonflow-app?style=for-the-badge" />
|
||||
@ -47,7 +57,7 @@
|
||||
|
||||
# 🌟 主要功能
|
||||
|
||||
Toonflow 是一款 AI 工具,能够利用 AI 技术将小说自动转化为剧本,并结合 AI 生成的图片和视频,实现高效的短剧创作。借助 Toonflow,可以轻松完成从文字到影像的全流程,让短剧制作变得更加智能与便捷。
|
||||
Toonflow 是一款 AI 短剧漫剧工具,能够利用 AI 技术将小说自动转化为剧本,并结合 AI 生成的图片和视频,实现高效的短剧创作。借助 Toonflow,可以轻松完成从文字到影像的全流程,让短剧制作变得更加智能与便捷。
|
||||
|
||||
- ✅ **角色生成**
|
||||
自动分析原始小说文本,智能识别并生成角色设定,包括外貌、性格、身份等详细信息,为后续剧本与画面创作提供可靠基础。
|
||||
@ -106,7 +116,10 @@ https://www.bilibili.com/video/BV1na6wB6Ea2
|
||||
| Linux | [Release](https://github.com/HBAI-Ltd/Toonflow-app/releases) | [夸克网盘](https://pan.quark.cn/s/94ef07509df0) | 官方发布安装包 |
|
||||
| macOS | [Release](https://github.com/HBAI-Ltd/Toonflow-app/releases) | [夸克网盘](https://pan.quark.cn/s/94ef07509df0) | 官方发布安装包 |
|
||||
|
||||
> 目前仅支持 Windows 版本,其他系统将陆续开放。
|
||||
> [!CAUTION]
|
||||
> MacOS 系统请到 设置-隐私与安全性 配置安全性否则可能因证书问题无法正常打开
|
||||
>
|
||||
> 参考知乎文档:[https://www.zhihu.com/question/433389276](https://www.zhihu.com/question/433389276)
|
||||
|
||||
> 因 Gitee OS 环境限制及 Release 文件上传大小限制,暂不提供 Gitee Release 下载地址。
|
||||
|
||||
@ -123,92 +136,46 @@ https://www.bilibili.com/video/BV1na6wB6Ea2
|
||||
### 前置条件
|
||||
|
||||
- 已安装 [Docker](https://docs.docker.com/get-docker/)(版本 20.10+)
|
||||
- 已安装 [Docker Compose](https://docs.docker.com/compose/install/)(版本 2.0+)
|
||||
|
||||
### 方式一:在线部署(推荐)
|
||||
### 方式一:在线部署
|
||||
|
||||
从 GitHub / Gitee 自动拉取源码并构建镜像:
|
||||
|
||||
```shell
|
||||
docker-compose -f docker/docker-compose.yml up -d --build
|
||||
```
|
||||
|
||||
**支持的构建参数:**
|
||||
|
||||
| 参数 | 说明 | 默认值 | 示例 |
|
||||
| -------- | ------------ | -------- | ------------------ |
|
||||
| `GIT` | 代码仓库源 | `github` | `github` / `gitee` |
|
||||
| `TAG` | 指定版本标签 | 最新 tag | `v1.0.6` |
|
||||
| `BRANCH` | 指定分支 | 默认分支 | `main` / `dev` |
|
||||
|
||||
**版本选择优先级**:指定 TAG > 指定 BRANCH > 自动获取最新 tag > 默认分支
|
||||
|
||||
**指定参数示例:**
|
||||
|
||||
```shell
|
||||
# 使用 Gitee 源(国内推荐,速度更快)
|
||||
GIT=gitee docker-compose -f docker/docker-compose.yml up -d --build
|
||||
|
||||
# 指定版本标签
|
||||
TAG=v1.0.6 docker-compose -f docker/docker-compose.yml up -d --build
|
||||
|
||||
# 指定分支 + Gitee 源
|
||||
GIT=gitee BRANCH=dev docker-compose -f docker/docker-compose.yml up -d --build
|
||||
```
|
||||
待完善,暂时使用本地构建。
|
||||
|
||||
### 方式二:本地构建
|
||||
|
||||
使用本地已有的源码直接构建,适合开发者或已克隆仓库的用户:
|
||||
使用本地已有的源码直接构建,适合开发者或已克隆仓库的用户,这需要你在本地安装 git:
|
||||
|
||||
```shell
|
||||
# 先克隆项目(如已有则跳过)
|
||||
git clone https://github.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
|
||||
# 使用本地源码构建
|
||||
docker-compose -f docker/docker-compose.local.yml up -d --build
|
||||
# 使用 docker-compose 本地构建并启动
|
||||
yarn docker:local
|
||||
|
||||
# 或者手动构建
|
||||
docker build -t toonflow .
|
||||
docker run -d -p <本地端口>:10588 -v <本地数据路径>:/app/data toonflow
|
||||
|
||||
# 此时在相应端口的 /web/index.html 路径即可访问页面
|
||||
# 例如 http://localhost:10588/web/index.html
|
||||
```
|
||||
|
||||
### 服务端口说明
|
||||
|
||||
| 端口 | 用途 | 在线部署映射 | 本地构建映射 |
|
||||
| ------- | -------------- | ------------- | ------------- |
|
||||
| `80` | Nginx 前端页面 | 随机端口 | `8080:80` |
|
||||
| `10588` | 后端 API 服务 | `10588:10588` | `10588:10588` |
|
||||
| 端口 | 用途 | 部署映射 |
|
||||
| ------- | -------- | ------------- |
|
||||
| `10588` | 软件界面 | `10588:10588` |
|
||||
|
||||
### 数据持久化
|
||||
**环境变量说明:**
|
||||
|
||||
默认日志目录会挂载到宿主机 `./logs` 目录。如需持久化上传文件或数据库,可在 `docker-compose.yml` 中添加 volumes:
|
||||
| 变量 | 说明 |
|
||||
| ---------- | ---------------------------------- |
|
||||
| `NODE_ENV` | 运行环境,`prod` 表示生产环境 |
|
||||
| `PORT` | 服务监听端口(默认 10588) |
|
||||
| `OSSURL` | 文件存储访问地址,用于静态资源访问 |
|
||||
|
||||
```yaml
|
||||
volumes:
|
||||
- ./logs:/var/log
|
||||
- ./uploads:/app/uploads # 持久化上传文件
|
||||
- ./data:/app/data # 持久化数据库(如有)
|
||||
```
|
||||
|
||||
### 常用操作命令
|
||||
|
||||
```shell
|
||||
# 查看容器状态
|
||||
docker-compose -f docker/docker-compose.yml ps
|
||||
|
||||
# 查看实时日志
|
||||
docker-compose -f docker/docker-compose.yml logs -f
|
||||
|
||||
# 停止服务
|
||||
docker-compose -f docker/docker-compose.yml down
|
||||
|
||||
# 重新构建并启动(更新版本时使用)
|
||||
docker-compose -f docker/docker-compose.yml up -d --build
|
||||
|
||||
# 进入容器调试
|
||||
docker exec -it toonflow sh
|
||||
```
|
||||
|
||||
> ⚠️ **首次登录**
|
||||
> 账号:`admin`
|
||||
> 密码:`admin123`
|
||||
---
|
||||
|
||||
## 云端部署
|
||||
|
||||
@ -260,7 +227,7 @@ yarn build
|
||||
```json
|
||||
{
|
||||
"name": "toonflow-app",
|
||||
"script": "build/app.js",
|
||||
"script": "data/serve/app.js",
|
||||
"instances": "max",
|
||||
"exec_mode": "cluster",
|
||||
"env": {
|
||||
@ -319,6 +286,23 @@ pm2 monit # 监控面板
|
||||
> 🚧 **PR 提交规范** 🚧
|
||||
>
|
||||
> ⛔ `master` 分支不接受任何 PR | ✅ 请将 PR 提交到 `develop` 分支
|
||||
>
|
||||
> 欢迎开发者们共同参与 Toonflow 的共创。如有兴趣加入,请在交流群内联系主理人 ACT
|
||||
|
||||
## 🛠️ 技术栈
|
||||
|
||||
| 类别 | 技术 |
|
||||
| ---------- | ----------------------------------------------------------------------------------------- |
|
||||
| 运行时 | Node.js 23.11.1+ |
|
||||
| 语言 | TypeScript 5.x |
|
||||
| 后端框架 | Express 5 |
|
||||
| 数据库 | SQLite(better-sqlite3 / knex) |
|
||||
| AI 集成 | Vercel AI SDK(OpenAI / Anthropic / Google / DeepSeek / 智谱 / MiniMax / 通义千问 / xAI) |
|
||||
| 本地推理 | @huggingface/transformers(ONNX) |
|
||||
| 实时通信 | Socket.IO |
|
||||
| 桌面客户端 | Electron 40 |
|
||||
| 图像处理 | Sharp |
|
||||
| 容器化 | Docker |
|
||||
|
||||
## 开发环境准备
|
||||
|
||||
@ -355,7 +339,7 @@ pm2 monit # 监控面板
|
||||
|
||||
本项目包含 **后端 API 服务** 和 **前端页面** 两部分,请根据需要选择启动方式:
|
||||
|
||||
- **方式一:仅启动后端服务(开发调试用)**
|
||||
- **方式一:仅启动后端服务**
|
||||
|
||||
```bash
|
||||
yarn dev
|
||||
@ -363,7 +347,7 @@ pm2 monit # 监控面板
|
||||
|
||||
> ⚠️ 此命令仅启动后端 API 服务(端口 10588),**不包含前端页面**。直接访问 `http://localhost:10588` 只能调用 API 接口,无法看到完整的网页界面。如需同时使用前端页面,请配合前端项目单独启动,或使用下方的 GUI 模式。
|
||||
|
||||
- **方式二:启动 Electron 桌面客户端(推荐完整体验)**
|
||||
- **方式二:启动 Electron 桌面客户端**
|
||||
|
||||
```bash
|
||||
yarn dev:gui
|
||||
@ -371,12 +355,13 @@ pm2 monit # 监控面板
|
||||
|
||||
> 此命令会同时启动后端服务和 Electron 桌面窗口,自带内置前端页面,开箱即用,无需额外配置。适合想要完整体验所有功能的开发者。
|
||||
|
||||
**两种模式对比:**
|
||||
- **方式三:生产模式启动**
|
||||
|
||||
| 命令 | 启动内容 | 前端页面 | 适用场景 |
|
||||
| -------------- | ------------------------ | -------- | -------------------------------- |
|
||||
| `yarn dev` | 仅后端 API(端口 10588) | ❌ 无 | 后端开发调试、配合前端项目联调 |
|
||||
| `yarn dev:gui` | 后端 + Electron 桌面端 | ✅ 内置 | 完整功能体验、桌面客户端开发调试 |
|
||||
```bash
|
||||
yarn start
|
||||
```
|
||||
|
||||
> 以生产模式直接运行编译后的服务(需先执行 `yarn build`)。
|
||||
|
||||
4. **项目打包**
|
||||
|
||||
@ -427,46 +412,62 @@ pm2 monit # 监控面板
|
||||
- **GitHub**:[Toonflow-web](https://github.com/HBAI-Ltd/Toonflow-web)
|
||||
- **Gitee**:[Toonflow-web](https://gitee.com/HBAI-Ltd/Toonflow-web)
|
||||
|
||||
前端构建后,将 `dist` 目录内容复制到本项目的 `scripts/web` 目录即可集成。
|
||||
前端构建后,将 `dist` 目录内容复制到本项目的 `data/web` 目录即可集成。
|
||||
|
||||
## 项目结构
|
||||
|
||||
```
|
||||
📂 docker/ # Docker 配置文件
|
||||
📂 docs/ # 文档资源
|
||||
📂 scripts/ # 构建脚本与静态资源
|
||||
📂 build/ # 编译产物
|
||||
📂 data/ # 运行时数据
|
||||
│ ├─ 📂 models/ # 本地推理模型(ONNX)
|
||||
│ ├─ 📂 oss/ # 对象存储(素材/角色/场景)
|
||||
│ ├─ 📂 serve/ # 生产环境入口
|
||||
│ ├─ 📂 skills/ # Agent 技能提示词
|
||||
│ └─ 📂 web/ # 前端编译产物(内置)
|
||||
📂 docs/ # 文档资源
|
||||
📂 env/ # 环境配置
|
||||
📂 scripts/ # 构建与辅助脚本
|
||||
📂 src/
|
||||
├─ 📂 agents/ # AI Agent 模块
|
||||
│ ├─ 📂 productionAgent/ # 生产 Agent
|
||||
│ └─ 📂 scriptAgent/ # 剧本 Agent
|
||||
├─ 📂 lib/ # 公共库(数据库初始化、响应格式)
|
||||
├─ 📂 middleware/ # 中间件
|
||||
├─ 📂 routes/ # 路由模块
|
||||
│ ├─ 📂 agents/ # Agent 记忆管理
|
||||
│ ├─ 📂 artStyle/ # 画风管理
|
||||
│ ├─ 📂 assets/ # 素材管理
|
||||
│ ├─ 📂 index/ # 首页
|
||||
│ ├─ 📂 assetsGenerate/ # 素材生成
|
||||
│ ├─ 📂 cornerScape/ # 分镜管理
|
||||
│ ├─ 📂 general/ # 通用接口
|
||||
│ ├─ 📂 login/ # 登录认证
|
||||
│ ├─ 📂 migrate/ # 数据迁移
|
||||
│ ├─ 📂 modelSelect/ # 模型选择
|
||||
│ ├─ 📂 novel/ # 小说管理
|
||||
│ ├─ 📂 other/ # 其他功能
|
||||
│ ├─ 📂 outline/ # 大纲管理
|
||||
│ ├─ 📂 production/ # 制作管理
|
||||
│ ├─ 📂 project/ # 项目管理
|
||||
│ ├─ 📂 prompt/ # 提示词管理
|
||||
│ ├─ 📂 script/ # 剧本生成
|
||||
│ ├─ 📂 scriptAgent/ # 剧本 Agent 接口
|
||||
│ ├─ 📂 setting/ # 系统设置
|
||||
│ ├─ 📂 storyboard/ # 分镜管理
|
||||
│ ├─ 📂 task/ # 任务管理
|
||||
│ ├─ 📂 user/ # 用户管理
|
||||
│ └─ 📂 video/ # 视频生成
|
||||
│ └─ 📂 test/ # 测试接口
|
||||
├─ 📂 socket/ # WebSocket 实时通信
|
||||
├─ 📂 types/ # TypeScript 类型声明
|
||||
├─ 📂 utils/ # 工具函数
|
||||
├─ 📄 app.ts # 应用入口
|
||||
├─ 📄 core.ts # 路由核心
|
||||
├─ 📄 core.ts # 核心初始化
|
||||
├─ 📄 env.ts # 环境变量处理
|
||||
├─ 📄 err.ts # 错误处理
|
||||
├─ 📄 logger.ts # 日志模块
|
||||
├─ 📄 router.ts # 路由注册
|
||||
└─ 📄 utils.ts # 通用工具
|
||||
📂 uploads/ # 上传文件目录
|
||||
📄 LICENSE # 许可证
|
||||
📄 Dockerfile # Docker 构建文件
|
||||
📄 electron-builder.yml # Electron 打包配置
|
||||
📄 skillList.json # 技能清单
|
||||
📄 LICENSE # 许可证(Apache-2.0)
|
||||
📄 NOTICES.txt # 第三方依赖声明
|
||||
📄 package.json # 项目配置
|
||||
📄 README.md # 项目说明
|
||||
📄 tsconfig.json # TypeScript 配置
|
||||
```
|
||||
|
||||
@ -483,46 +484,13 @@ pm2 monit # 监控面板
|
||||
|
||||
---
|
||||
|
||||
# 📝 开发计划
|
||||
|
||||
我们正持续优化产品,以下为近期开发重点:
|
||||
|
||||
1. 核心功能升级
|
||||
|
||||
- `🧩 提示词润色生成 Agent` 基于 AI 智能润色视频提示词,自动拆解生成分镜脚本,支持多镜头智能融合与平滑过渡
|
||||
- `📄 多格式文本支持` 扩展小说以外的剧本、漫画脚本、游戏对话文本等多种格式的智能解析
|
||||
|
||||
2. 生产流程优化
|
||||
|
||||
- `👗 角色服化道管理` 强化长篇内容中角色的服装、化妆、道具一致性,支持多剧集关联记忆和着装自动生成
|
||||
- `📦 批量处理/任务队列` 支持多章节同时处理,后台任务管理,进度实时监控和中断恢复
|
||||
|
||||
3. 视觉生成增强
|
||||
|
||||
- `🎭 多风格模板库` 内置多种视觉风格包,支持一键风格转换和用户自定义风格保存
|
||||
- `⏱️ 智能节奏分析/优化` 分析剧情情绪曲线,自动建议高潮点和节奏变化,优化分镜安排生产流程优化
|
||||
|
||||
---
|
||||
|
||||
# 👨👩👧👦 微信交流群
|
||||
|
||||
~~交流群 1~~
|
||||
|
||||
~~交流群 2~~
|
||||
|
||||
~~交流群 3~~
|
||||
|
||||
~~交流群 4~~
|
||||
|
||||
~~交流群 5~~
|
||||
|
||||
~~交流群 6~~
|
||||
|
||||
~~交流群 7~~
|
||||
|
||||
~~交流群 8~~
|
||||
|
||||
~~交流群 9~~
|
||||
...
|
||||
|
||||
~~交流群 10~~
|
||||
|
||||
@ -532,9 +500,13 @@ pm2 monit # 监控面板
|
||||
|
||||
~~交流群 13~~
|
||||
|
||||
...
|
||||
|
||||
~~交流群 24~~
|
||||
|
||||
拉群小助手:
|
||||
|
||||
<img src="./docs/QR.png" alt="Toonflow Logo" height="400"/>
|
||||
<img src="./docs/QR.png" alt="Toonflow QR" height="400"/>
|
||||
|
||||
---
|
||||
|
||||
@ -546,11 +518,36 @@ pm2 monit # 监控面板
|
||||
|
||||
# 📜 许可证
|
||||
|
||||
Toonflow 基于 AGPL-3.0 协议开源发布,许可证详情:https://www.gnu.org/licenses/agpl-3.0.html
|
||||
Toonflow 基于 Apache-2.0 协议开源发布,并附有补充商业协议。
|
||||
|
||||
您可以在遵循 AGPL-3.0 相关条款与条件的情况下,将 Toonflow 用于包括商业目的在内的各类用途。
|
||||
许可证详情:https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
如需获得免于 AGPL-3.0 限制的专有商业许可,请通过邮箱与我们联系。
|
||||
## 补充协议
|
||||
|
||||
- 若将本软件以产品形式分发给 **2 个及以上独立第三方**使用,须取得 HBAI-Ltd **书面商业授权**。
|
||||
- **≤ 5 个法人**联合运营内部使用,不对外提供服务的,视为内部使用,**无需授权**。
|
||||
- 不得删除或修改 Toonflow 中的标识或版权信息。
|
||||
|
||||
## 永久免费场景
|
||||
|
||||
- ✅ 用 Toonflow 制作内容并获得平台分账
|
||||
- ✅ 二次开发供自己团队内部使用
|
||||
- ✅ ≤ 5 个法人联合运营内部使用
|
||||
- ✅ 个人学习、研究、非商业用途
|
||||
|
||||
## 商业授权定价
|
||||
|
||||
| 阶段 | 年销售额 | 年费 |
|
||||
|------|---------|------|
|
||||
| 🌱 扶持期 | < ¥10 万 | **免费** |
|
||||
| 🚀 初创期 | ¥10–50 万 | ¥5,000/年 |
|
||||
| 📈 成长期 | ¥50–150 万 | ¥20,000/年 |
|
||||
| 🏢 规模期 | ¥150–500 万 | ¥80,000/年 |
|
||||
| 🌐 企业级 | > ¥500 万 | 面议 |
|
||||
|
||||
> **不追溯条款**:v1.0.8 发布前基于 AGPL-3.0 使用的用户,继续按 AGPL-3.0 执行,不受本协议变更约束。
|
||||
|
||||
完整协议详见 [LICENSE](./LICENSE) 文件。
|
||||
|
||||
---
|
||||
|
||||
@ -565,13 +562,14 @@ Toonflow 基于 AGPL-3.0 协议开源发布,许可证详情:https://www.gnu.
|
||||
感谢以下开源项目为 Toonflow 提供强大支持:
|
||||
|
||||
- [Express](https://expressjs.com/) - 快速、开放、极简的 Node.js Web 框架
|
||||
- [AI](https://ai-sdk.dev/) - 面向 TypeScript 的 AI 工具包
|
||||
- [AI SDK](https://ai-sdk.dev/) - 面向 TypeScript 的 AI 工具包
|
||||
- [Better-SQLite3](https://github.com/WiseLibs/better-sqlite3) - 高性能 SQLite3 绑定库
|
||||
- [Sharp](https://sharp.pixelplumbing.com/) - 高性能 Node.js 图像处理库
|
||||
- [Axios](https://axios-http.com/) - 基于 Promise 的 HTTP 客户端
|
||||
- [Zod](https://zod.dev/) - TypeScript 优先的模式验证库
|
||||
- [Aigne](https://github.com/aigne-com/aigne) - LLM API 统一管理与接入中间件
|
||||
- [Socket.IO](https://socket.io/) - 实时双向事件通信引擎
|
||||
- [Electron](https://www.electronjs.org/) - 跨平台桌面应用开发框架
|
||||
- [Hugging Face Transformers](https://huggingface.co/docs/transformers.js) - 本地 ML 推理库
|
||||
|
||||
感谢以下组织/单位/个人为 Toonflow 提供支持:
|
||||
|
||||
|
||||
2244
data/web/index.html
@ -1,121 +0,0 @@
|
||||
# 构建阶段
|
||||
FROM node:24-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# 定义构建参数
|
||||
ARG GIT=github
|
||||
ARG TAG=""
|
||||
ARG BRANCH=""
|
||||
|
||||
# 安装 git
|
||||
RUN apk add --no-cache git
|
||||
|
||||
RUN npm config set registry https://registry.npmmirror.com/ && \
|
||||
yarn config set registry https://registry.npmmirror.com/
|
||||
|
||||
# 根据参数选择仓库源,支持 TAG / BRANCH 切换
|
||||
# 优先级: TAG > BRANCH > 最新 tag > 默认分支
|
||||
RUN if [ "$GIT" = "gitee" ]; then \
|
||||
REPO_URL="https://gitee.com/HBAI-Ltd/Toonflow-app.git"; \
|
||||
else \
|
||||
REPO_URL="https://github.com/HBAI-Ltd/Toonflow-app.git"; \
|
||||
fi && \
|
||||
echo "Cloning from: $REPO_URL" && \
|
||||
git clone "$REPO_URL" . && \
|
||||
if [ -n "$TAG" ]; then \
|
||||
echo "Checking out specified tag: $TAG" && \
|
||||
git checkout "$TAG"; \
|
||||
elif [ -n "$BRANCH" ]; then \
|
||||
echo "Checking out specified branch: $BRANCH" && \
|
||||
git checkout "$BRANCH"; \
|
||||
else \
|
||||
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || git tag --sort=-v:refname | head -n 1) && \
|
||||
if [ -n "$LATEST_TAG" ]; then \
|
||||
echo "Checking out latest tag: $LATEST_TAG" && \
|
||||
git checkout "$LATEST_TAG"; \
|
||||
else \
|
||||
echo "No tags found, using default branch"; \
|
||||
fi; \
|
||||
fi && \
|
||||
echo "Current version:" && git describe --tags --always
|
||||
|
||||
RUN yarn install --frozen-lockfile
|
||||
|
||||
RUN yarn build
|
||||
|
||||
# 生产阶段
|
||||
FROM node:24-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# 安装 nginx 和 supervisor
|
||||
RUN apk add --no-cache nginx supervisor && \
|
||||
mkdir -p /var/lib/nginx/logs /var/log/nginx && \
|
||||
npm config set registry https://registry.npmmirror.com/ && \
|
||||
yarn config set registry https://registry.npmmirror.com/ && \
|
||||
npm install -g pm2
|
||||
|
||||
# 复制后端文件
|
||||
COPY --from=builder /app/build ./build
|
||||
COPY --from=builder /app/data/serve ./data/serve
|
||||
COPY --from=builder /app/package.json ./
|
||||
COPY --from=builder /app/yarn.lock ./
|
||||
|
||||
# 复制静态页面到 nginx 目录
|
||||
COPY --from=builder /app/scripts/web /usr/share/nginx/html
|
||||
|
||||
# 只安装生产依赖
|
||||
RUN yarn install --frozen-lockfile --production
|
||||
|
||||
# 配置 nginx
|
||||
RUN cat > /etc/nginx/http.d/default.conf << 'EOF'
|
||||
server {
|
||||
listen 80;
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
# 配置 nginx 主配置,日志输出到 stderr/stdout
|
||||
RUN sed -i 's|error_log /var/log/nginx/error.log warn;|error_log /dev/stderr warn;|g' /etc/nginx/nginx.conf || true && \
|
||||
sed -i 's|access_log /var/log/nginx/access.log main;|access_log /dev/stdout main;|g' /etc/nginx/nginx.conf || true
|
||||
|
||||
# 配置 supervisor
|
||||
RUN cat > /etc/supervisord.conf << 'EOF'
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
logfile=/var/log/supervisord.log
|
||||
pidfile=/var/run/supervisord.pid
|
||||
|
||||
[program:nginx]
|
||||
command=nginx -g "daemon off;"
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
|
||||
[program:app]
|
||||
command=pm2-runtime start data/serve/app.js --name app
|
||||
directory=/app
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
environment=NODE_ENV=prod
|
||||
EOF
|
||||
|
||||
ENV NODE_ENV=prod
|
||||
|
||||
EXPOSE 80
|
||||
EXPOSE 10588
|
||||
|
||||
# 启动时创建必要目录(防止 volume 挂载覆盖)
|
||||
CMD sh -c "mkdir -p /var/log/nginx /var/lib/nginx/logs && exec supervisord -c /etc/supervisord.conf"
|
||||
@ -1,95 +0,0 @@
|
||||
# 本地构建阶段 - 使用本地源码,不从 git 克隆
|
||||
FROM node:24-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN npm config set registry https://registry.npmmirror.com/ && \
|
||||
yarn config set registry https://registry.npmmirror.com/
|
||||
|
||||
# 复制依赖文件
|
||||
COPY package.json yarn.lock ./
|
||||
|
||||
RUN yarn install --frozen-lockfile
|
||||
|
||||
# 复制源码
|
||||
COPY tsconfig.json ./
|
||||
COPY src/ ./src/
|
||||
COPY scripts/ ./scripts/
|
||||
|
||||
RUN yarn build
|
||||
|
||||
# 生产阶段
|
||||
FROM node:24-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# 安装 nginx 和 supervisor
|
||||
RUN apk add --no-cache nginx supervisor && \
|
||||
mkdir -p /var/lib/nginx/logs /var/log/nginx && \
|
||||
npm config set registry https://registry.npmmirror.com/ && \
|
||||
yarn config set registry https://registry.npmmirror.com/ && \
|
||||
npm install -g pm2
|
||||
|
||||
# 复制后端文件
|
||||
COPY --from=builder /app/build ./build
|
||||
COPY --from=builder /app/data/serve ./data/serve
|
||||
COPY --from=builder /app/package.json ./
|
||||
COPY --from=builder /app/yarn.lock ./
|
||||
|
||||
# 复制静态页面到 nginx 目录
|
||||
COPY --from=builder /app/scripts/web /usr/share/nginx/html
|
||||
|
||||
# 只安装生产依赖
|
||||
RUN yarn install --frozen-lockfile --production
|
||||
|
||||
# 配置 nginx
|
||||
RUN cat > /etc/nginx/http.d/default.conf << 'EOF'
|
||||
server {
|
||||
listen 80;
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
EOF
|
||||
|
||||
# 配置 nginx 主配置,日志输出到 stderr/stdout
|
||||
RUN sed -i 's|error_log /var/log/nginx/error.log warn;|error_log /dev/stderr warn;|g' /etc/nginx/nginx.conf || true && \
|
||||
sed -i 's|access_log /var/log/nginx/access.log main;|access_log /dev/stdout main;|g' /etc/nginx/nginx.conf || true
|
||||
|
||||
# 配置 supervisor
|
||||
RUN cat > /etc/supervisord.conf << 'EOF'
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
logfile=/var/log/supervisord.log
|
||||
pidfile=/var/run/supervisord.pid
|
||||
|
||||
[program:nginx]
|
||||
command=nginx -g "daemon off;"
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
|
||||
[program:app]
|
||||
command=pm2-runtime start data/serve/app.js --name app
|
||||
directory=/app
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
environment=NODE_ENV=prod
|
||||
EOF
|
||||
|
||||
ENV NODE_ENV=prod
|
||||
|
||||
EXPOSE 80
|
||||
EXPOSE 10588
|
||||
|
||||
# 启动时创建必要目录(防止 volume 挂载覆盖)
|
||||
CMD sh -c "mkdir -p /var/log/nginx /var/lib/nginx/logs && exec supervisord -c /etc/supervisord.conf"
|
||||
@ -1,24 +0,0 @@
|
||||
# 本地打包测试用,使用本地源码构建
|
||||
# 用法: docker-compose -f docker/docker-compose.local.yml up -d --build
|
||||
|
||||
services:
|
||||
toonflow:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: docker/Dockerfile.local
|
||||
image: toonflow:local
|
||||
container_name: toonflow-local
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8080:80"
|
||||
- "10588:10588"
|
||||
environment:
|
||||
- NODE_ENV=prod
|
||||
volumes:
|
||||
- ../logs:/var/log
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:80/"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
@ -1,26 +0,0 @@
|
||||
services:
|
||||
toonflow:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: docker/Dockerfile
|
||||
args:
|
||||
GIT: ${GIT:-github}
|
||||
TAG: ${TAG:-}
|
||||
BRANCH: ${BRANCH:-}
|
||||
image: toonflow:${TAG:-latest}
|
||||
container_name: toonflow
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "80"
|
||||
- "10588:10588"
|
||||
environment:
|
||||
- NODE_ENV=prod
|
||||
volumes:
|
||||
# 可选: 持久化日志
|
||||
- ../logs:/var/log
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:80/"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
@ -6,11 +6,21 @@
|
||||
<a href="https://gitee.com/HBAI-Ltd/Toonflow-app">
|
||||
<img src="https://img.shields.io/badge/Gitee-C71D23?style=flat-square&logo=gitee&logoColor=white" alt="Gitee" />
|
||||
</a>
|
||||
|
|
||||
<a href="https://gitcode.com/HBAI-Ltd/Toonflow-app">
|
||||
<img src="./atomgitLogo.png" alt="Atomgit" style="height:16px"/>
|
||||
Atomgit
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="../README.md">中文</a> |
|
||||
<strong>English</strong>
|
||||
<a href="/README.md">简体中文</a> |
|
||||
<a href="./README.zhtw.md">繁體中文</a> |
|
||||
<strong>English</strong> |
|
||||
<a href="./README.th.md">ไทย</a> |
|
||||
<a href="./README.vi.md">Tiếng Việt</a> |
|
||||
<a href="./README.jp.md">日本語</a> |
|
||||
<a href="./README.ru.md">Русский</a>
|
||||
</p>
|
||||
|
||||
<div align="center">
|
||||
@ -23,48 +33,48 @@
|
||||
<b>
|
||||
AI Short Drama Factory
|
||||
<br />
|
||||
Turn novels into episodes with a tap!
|
||||
With a tap, novels instantly become episodes!
|
||||
<br />
|
||||
AI Script × AI Imagery × Lightning-fast Generation 🔥
|
||||
AI scripts × AI visuals × Turbo generation 🔥
|
||||
</b>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://github.com/HBAI-Ltd/Toonflow-app/stargazers">
|
||||
<img src="https://img.shields.io/github/stars/HBAI-Ltd/Toonflow-app?style=for-the-badge&logo=github" alt="Stars Badge" />
|
||||
</a>
|
||||
<a href="https://www.gnu.org/licenses/agpl-3.0" target="_blank">
|
||||
<img src="https://img.shields.io/badge/License-AGPL-blue.svg?style=for-the-badge" alt="AGPL License Badge" />
|
||||
<a href="https://www.apache.org/licenses/LICENSE-2.0" target="_blank">
|
||||
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=for-the-badge" alt="Apache-2.0 License Badge" />
|
||||
</a>
|
||||
<a href="https://github.com/HBAI-Ltd/Toonflow-app/releases">
|
||||
<img alt="release" src="https://img.shields.io/github/v/release/HBAI-Ltd/Toonflow-app?style=for-the-badge" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
> 🚀 **One-stop Short Drama Workflow**: From text to character, storyboard to video, a full AI-powered process with zero threshold, boosting creative efficiency by 10x+!
|
||||
> 🚀 **One-stop short drama production**: From text to characters, from storyboard to video, 0 barrier full-process AI, 10x+ creation efficiency!
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
# 🌟 Main Features
|
||||
|
||||
Toonflow is an AI tool that leverages AI technology to automatically turn novels into scripts, then uses AI to generate images and videos for efficient short drama production. With Toonflow, you can easily accomplish the entire workflow from text to visuals, making short drama creation more intelligent and convenient.
|
||||
Toonflow is an AI short drama comic tool that leverages AI technology to automatically convert novels into scripts, and uses AI-generated images and videos for efficient short drama creation. With Toonflow, you can easily complete the entire process from text to images, making short drama production more intelligent and convenient.
|
||||
|
||||
- ✅ **Character Generation**
|
||||
Automatically analyzes the original novel text, intelligently recognizes and generates character profiles, including appearance, personality, identity, etc., providing a reliable foundation for subsequent script and image creation.
|
||||
Automatically analyzes the original novel text, intelligently identifies and generates character settings, including appearance, personality, identity, etc., providing a reliable foundation for subsequent script and visual creation.
|
||||
- ✅ **Script Generation**
|
||||
Based on selected events and chapters, the system automatically generates structured scripts, covering dialogue, scene descriptions, and plot direction, enabling an efficient transition from literary text to screenplay.
|
||||
- ✅ **Storyboard Creation**
|
||||
According to the script content, it intelligently generates storyboard prompts and visual designs, detailing foreground, middle ground, background, character movements, props, and scene layouts. Automatically produces storyboards from the script, providing a comprehensive blueprint for video production.
|
||||
- ✅ **Video Synthesis**
|
||||
Integrates AI image and video techniques, supporting generation of video clips via AI. With built-in online editing, supports personalized adjustments and outputs, making filmmaking highly collaborative and efficient.
|
||||
Based on selected events and chapters, the system automatically generates structured scripts, covering dialogue, scene descriptions, and plot direction, enabling efficient transformation from literary texts to film/TV scripts.
|
||||
- ✅ **Storyboard Production**
|
||||
Based on the script content, intelligently generates storyboard prompts and visual design, detailing foreground/midground/background, character dynamics, prop settings, and scene layout; automatically turns scripts into storyboards, providing a complete route blueprint for video production.
|
||||
- ✅ **Video Composition**
|
||||
Integrates AI image and video technologies to generate video clips using AI. Includes online editing and supports personalized output adjustments, making film & TV production collaborative and efficient.
|
||||
|
||||
---
|
||||
|
||||
# 📦 Application Scenarios
|
||||
|
||||
- Short video content production
|
||||
- Novel-to-film experiments
|
||||
- AI Literary Adaptation Tools
|
||||
- Short video content creation
|
||||
- Novel-to-film/TV experiments
|
||||
- AI literature adaptation tools
|
||||
- Script development and rapid prototyping
|
||||
- Video material generation
|
||||
|
||||
@ -75,14 +85,14 @@ Toonflow is an AI tool that leverages AI technology to automatically turn novels
|
||||
## 📺 Video Tutorial
|
||||
|
||||
https://www.bilibili.com/video/BV1na6wB6Ea2
|
||||
[](https://www.bilibili.com/video/BV1na6wB6Ea2)
|
||||
[](https://www.bilibili.com/video/BV1na6wB6Ea2)
|
||||
|
||||
**Toonflow 8-Minute Quick Start AI Video**
|
||||
👉 [Click to watch](https://www.bilibili.com/video/BV1na6wB6Ea2/?share_source=copy_web&vd_source=5b718c25439a901a34c7bc0c1d35b38e)
|
||||
|
||||
📱 Watch via WeChat QR scan
|
||||
📱 Scan with WeChat on your phone to watch
|
||||
|
||||
<img src="./videoQR.png" alt="Watch on WeChat" width="150"/>
|
||||
<img src="./videoQR.png" alt="Scan WeChat to Watch" width="150"/>
|
||||
|
||||
---
|
||||
|
||||
@ -92,56 +102,103 @@ https://www.bilibili.com/video/BV1na6wB6Ea2
|
||||
|
||||
Before installing and using this software, please prepare the following:
|
||||
|
||||
- ✅ Large Language Model AI service endpoint.
|
||||
- ✅ Sora or Doubao video service endpoint
|
||||
- ✅ Nano Banana Pro image generation model service endpoint
|
||||
- ✅ Large language model AI service API address
|
||||
- ✅ Sora or Doubao video service API address
|
||||
- ✅ Nano Banana Pro image generation model service API
|
||||
|
||||
## Local Installation
|
||||
|
||||
### 1. Download & Install
|
||||
|
||||
| Operating System | GitHub Download | 123YunPan Download | Description |
|
||||
| :--------------: | :---------------------------------------------------------- | :-------------------------------------------------------- | :---------------------------------------------------------- |
|
||||
| Windows | [Release](https://github.com/HBAI-Ltd/Toonflow-app/releases) | [123YunPan](https://www.123865.com/s/bkn5Vv-E67cv) | Official release installation package |
|
||||
| Linux | ⚙️ Coming soon | ⚙️ Coming soon | To be released soon |
|
||||
| macOS | ⚙️ Coming soon | ⚙️ Coming soon | To be released soon |
|
||||
| Operating System | GitHub Download | Quark Cloud Download | Notes |
|
||||
| :--------------: | :------------------------------------------------------------ | :----------------------------------------------- | :------------- |
|
||||
| Windows | [Release](https://github.com/HBAI-Ltd/Toonflow-app/releases) | [Quark Cloud](https://pan.quark.cn/s/94ef07509df0) | Official installer |
|
||||
| Linux | [Release](https://github.com/HBAI-Ltd/Toonflow-app/releases) | [Quark Cloud](https://pan.quark.cn/s/94ef07509df0) | Official installer |
|
||||
| macOS | [Release](https://github.com/HBAI-Ltd/Toonflow-app/releases) | [Quark Cloud](https://pan.quark.cn/s/94ef07509df0) | Official installer |
|
||||
|
||||
> ⚠️ If 123YunPan prompts for payment, it is only due to bandwidth limitations. This software is completely open-source and free.
|
||||
> [!CAUTION]
|
||||
> On MacOS, please go to Settings - Privacy & Security to configure security settings, otherwise, you may not be able to open the app due to certificate issues.
|
||||
>
|
||||
> See Zhihu documentation: [https://www.zhihu.com/question/433389276](https://www.zhihu.com/question/433389276)
|
||||
|
||||
> Currently, only the Windows version is supported. Other systems will be released gradually.
|
||||
> Due to Gitee OS environment and Release file upload size limits, Gitee Release download is currently not available.
|
||||
|
||||
> Due to Gitee OS environment and file size restrictions for Release uploads, Gitee Release download links are not provided for now.
|
||||
### 2. Start Service
|
||||
|
||||
### 2. Launch the Service
|
||||
After installation, launch the program to start using this service.
|
||||
|
||||
After installation, start the program to use the service.
|
||||
|
||||
> ⚠️ **First login**
|
||||
> Account: `admin`
|
||||
> ⚠️ **First-time Login**
|
||||
> Username: `admin`
|
||||
> Password: `admin123`
|
||||
|
||||
## Docker Deployment
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- [Docker](https://docs.docker.com/get-docker/) installed (version 20.10+)
|
||||
|
||||
### Method 1: Online Deployment
|
||||
|
||||
To be developed; please use local build for now.
|
||||
|
||||
### Method 2: Local Build
|
||||
|
||||
Build directly from local source code, suitable for developers or users who have cloned the repo; requires Git installed locally:
|
||||
|
||||
```shell
|
||||
# Clone the project (skip if already cloned)
|
||||
git clone https://github.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
|
||||
# Build and start locally with docker-compose
|
||||
yarn docker:local
|
||||
|
||||
# Or build manually
|
||||
docker build -t toonflow .
|
||||
docker run -d -p <local_port>:10588 -v <local_data_path>:/app/data toonflow
|
||||
|
||||
# After this, the site can be accessed at /web/index.html on the mapped port
|
||||
# e.g. http://localhost:10588/web/index.html
|
||||
```
|
||||
|
||||
### Service Port Description
|
||||
|
||||
| Port | Purpose | Deployment Mapping |
|
||||
| -------- | ------------ | -------------------- |
|
||||
| `10588` | App Interface | `10588:10588` |
|
||||
|
||||
**Environment variable descriptions:**
|
||||
|
||||
| Variable | Description |
|
||||
| ------------- | ------------------------------------------- |
|
||||
| `NODE_ENV` | Environment; `prod` for production |
|
||||
| `PORT` | Service listening port (default 10588) |
|
||||
| `OSSURL` | File storage access address for static files |
|
||||
|
||||
---
|
||||
|
||||
## Cloud Deployment
|
||||
|
||||
### I. Server Requirements
|
||||
### 1. Server Requirements
|
||||
|
||||
- **OS**: Ubuntu 20.04+ / CentOS 7+
|
||||
- **Node.js**: 23.11.1+
|
||||
- **RAM**: 1GB+
|
||||
- **OS:** Ubuntu 20.04+ / CentOS 7+
|
||||
- **Node.js:** 24.x (recommended, minimum 23.11.1+)
|
||||
- **RAM:** 2GB+
|
||||
|
||||
### II. Server Deployment
|
||||
### 2. Server Deployment
|
||||
|
||||
#### 1. Install the Environment
|
||||
#### 1. Install Environment
|
||||
|
||||
```bash
|
||||
# Install Node.js
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
||||
source ~/.bashrc
|
||||
nvm install 24
|
||||
# Install Yarn & PM2
|
||||
# Install Yarn and PM2
|
||||
npm install -g yarn pm2
|
||||
```
|
||||
|
||||
#### 2. Deploy the Project
|
||||
#### 2. Deploy Project
|
||||
|
||||
**Clone from GitHub:**
|
||||
|
||||
@ -153,7 +210,7 @@ yarn install
|
||||
yarn build
|
||||
```
|
||||
|
||||
**Clone from Gitee (recommended in China):**
|
||||
**Clone from Gitee (Mainland China recommended):**
|
||||
|
||||
```bash
|
||||
cd /opt
|
||||
@ -170,7 +227,7 @@ Create a `pm2.json` file:
|
||||
```json
|
||||
{
|
||||
"name": "toonflow-app",
|
||||
"script": "build/app.js",
|
||||
"script": "data/serve/app.js",
|
||||
"instances": "max",
|
||||
"exec_mode": "cluster",
|
||||
"env": {
|
||||
@ -181,17 +238,17 @@ Create a `pm2.json` file:
|
||||
}
|
||||
```
|
||||
|
||||
**Environment Variable Description:**
|
||||
**Environment variable descriptions:**
|
||||
|
||||
| Variable | Description |
|
||||
| ------------ | ------------------------------------------- |
|
||||
| `NODE_ENV` | Runtime environment, `prod` means production|
|
||||
| ------------- | ------------------------------------------- |
|
||||
| `NODE_ENV` | Environment; `prod` for production |
|
||||
| `PORT` | Service listening port |
|
||||
| `OSSURL` | File storage access address for static files |
|
||||
|
||||
---
|
||||
|
||||
#### 4. Start the Service
|
||||
#### 4. Start Service
|
||||
|
||||
```bash
|
||||
pm2 start pm2.json
|
||||
@ -202,242 +259,331 @@ pm2 save
|
||||
#### 5. Common Commands
|
||||
|
||||
```bash
|
||||
pm2 list # List processes
|
||||
pm2 list # View process list
|
||||
pm2 logs toonflow-app # View logs
|
||||
pm2 restart all # Restart all services
|
||||
pm2 restart all # Restart service
|
||||
pm2 monit # Monitoring panel
|
||||
```
|
||||
|
||||
#### 6. Deploy the Frontend Website
|
||||
> ⚠️ **First-time Login**
|
||||
> Username: `admin`
|
||||
> Password: `admin123`
|
||||
|
||||
To deploy or customize the frontend separately, refer to the frontend repo:
|
||||
#### 6. Deploying the Frontend Website
|
||||
|
||||
For standalone frontend deployment or customization, refer to the frontend repository:
|
||||
|
||||
- **GitHub**: [Toonflow-web](https://github.com/HBAI-Ltd/Toonflow-web)
|
||||
- **Gitee**: [Toonflow-web](https://gitee.com/HBAI-Ltd/Toonflow-web)
|
||||
|
||||
> 💡 **Note**: This repo includes pre-compiled frontend assets; regular users don’t need to deploy frontend separately. The frontend repo is for developers needing secondary development.
|
||||
> 💡 **Note:** This repo already contains a compiled frontend by default. Regular users do NOT need to separately deploy the frontend. The frontend repo is for developers requiring secondary development.
|
||||
|
||||
---
|
||||
|
||||
# 🔧 Development Workflow Guide
|
||||
# 🔧 Developer Guide
|
||||
|
||||
> [!CAUTION]
|
||||
> 🚧 **PR Submission Guidelines** 🚧
|
||||
>
|
||||
> ⛔ `master` branch does NOT accept PRs | ✅ Please submit PRs to the `develop` branch
|
||||
>
|
||||
> Developers are invited to co-develop Toonflow. To join, contact owner ACT in the group chat.
|
||||
|
||||
## 🛠️ Tech Stack
|
||||
|
||||
| Category | Technology |
|
||||
| ------------ | --------------------------------------------------------------------------------------- |
|
||||
| Runtime | Node.js 23.11.1+ |
|
||||
| Language | TypeScript 5.x |
|
||||
| Backend | Express 5 |
|
||||
| Database | SQLite (better-sqlite3 / knex) |
|
||||
| AI Integration | Vercel AI SDK (OpenAI / Anthropic / Google / DeepSeek / Zhipu / MiniMax / Qwen / xAI)|
|
||||
| Local Inference | @huggingface/transformers (ONNX) |
|
||||
| Real-Time | Socket.IO |
|
||||
| Desktop | Electron 40 |
|
||||
| Image Proc. | Sharp |
|
||||
| Container | Docker |
|
||||
|
||||
## Development Environment Preparation
|
||||
|
||||
- **Node.js**: Version 23.11.1+
|
||||
- **Yarn**: Recommended package manager
|
||||
- **Node.js:** version 23.11.1 or above required
|
||||
- **Yarn:** recommended as the package manager
|
||||
|
||||
## Quick Project Startup
|
||||
## Quick Start
|
||||
|
||||
1. **Clone the project**
|
||||
|
||||
**From GitHub:**
|
||||
**Clone from GitHub:**
|
||||
|
||||
```bash
|
||||
git clone https://github.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
```
|
||||
|
||||
**From Gitee (china):**
|
||||
**Clone from Gitee (Mainland China recommended):**
|
||||
|
||||
```bash
|
||||
git clone https://gitee.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
```
|
||||
|
||||
2. **Install Dependencies**
|
||||
2. **Install dependencies**
|
||||
|
||||
Run the following in the root directory:
|
||||
In the project root directory, install dependencies:
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
3. **Start Development Server**
|
||||
3. **Start development environment**
|
||||
|
||||
- Launch dev server with Node.js:
|
||||
This project includes both **backend API service** and **frontend interface**. Start as needed:
|
||||
|
||||
- **Option 1: Start backend service only**
|
||||
|
||||
```bash
|
||||
yarn dev #port 10588
|
||||
yarn dev
|
||||
```
|
||||
|
||||
- Use Bun to quickly start dev server:
|
||||
> ⚠️ This command starts only the backend API (port 10588), **without the web interface**. Accessing `http://localhost:10588` allows API calls only; the full web UI is unavailable. To use the frontend, start the frontend project separately or use GUI mode below.
|
||||
|
||||
- **Option 2: Start Electron desktop client**
|
||||
|
||||
```bash
|
||||
yarn bun:dev #port 10588
|
||||
yarn dev:gui
|
||||
```
|
||||
|
||||
4. **Build the Project**
|
||||
> This command starts both backend and Electron window, with built-in web UI. Out-of-the-box, no extra config needed. Recommended for a full experience.
|
||||
|
||||
- Compile and generate TypeScript files:
|
||||
- **Option 3: Production mode**
|
||||
|
||||
```bash
|
||||
yarn start
|
||||
```
|
||||
|
||||
> Runs compiled service in production mode (requires `yarn build` first).
|
||||
|
||||
4. **Build the project**
|
||||
|
||||
- Compile TypeScript files:
|
||||
|
||||
```bash
|
||||
yarn build
|
||||
```
|
||||
|
||||
- Package as a Windows executable:
|
||||
- Build executable for Windows:
|
||||
|
||||
```bash
|
||||
yarn dist:win
|
||||
```
|
||||
|
||||
5. **Code Quality Check**
|
||||
- Build executable for Mac:
|
||||
|
||||
- Lint globally for syntax and style:
|
||||
```bash
|
||||
yarn dist:mac
|
||||
```
|
||||
|
||||
- Build executable for Linux:
|
||||
|
||||
```bash
|
||||
yarn dist:linux
|
||||
```
|
||||
|
||||
5. **Code quality check**
|
||||
|
||||
- Perform lint check:
|
||||
|
||||
```bash
|
||||
yarn lint
|
||||
```
|
||||
|
||||
6. **AI Debug panel (Optional)**
|
||||
|
||||
Start the Vercel AI SDK visual debugging tool for easier AI integration debugging:
|
||||
|
||||
```bash
|
||||
yarn debug:ai
|
||||
```
|
||||
|
||||
## Frontend Development
|
||||
|
||||
To modify the frontend, go to the frontend repo:
|
||||
To modify the frontend UI, develop in the frontend repository:
|
||||
|
||||
- **GitHub**: [Toonflow-web](https://github.com/HBAI-Ltd/Toonflow-web)
|
||||
- **Gitee**: [Toonflow-web](https://gitee.com/HBAI-Ltd/Toonflow-web)
|
||||
|
||||
After building the frontend, copy the contents of the `dist` folder into this project’s `scripts/web` directory for integration.
|
||||
After frontend build, copy the `dist` contents to this project's `data/web` to integrate.
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
📂 docs/ # Documentation
|
||||
📂 scripts/ # Build scripts and static resources
|
||||
│ └─ 📂 web/ # Embedded frontend build output
|
||||
📂 build/ # Compiled output
|
||||
📂 data/ # Runtime data
|
||||
│ ├─ 📂 models/ # Local inference models (ONNX)
|
||||
│ ├─ 📂 oss/ # Object storage (assets/characters/scenes)
|
||||
│ ├─ 📂 serve/ # Production entry
|
||||
│ ├─ 📂 skills/ # Agent skill prompts
|
||||
│ └─ 📂 web/ # Built-in frontend assets
|
||||
📂 ./ # Documentation assets
|
||||
📂 env/ # Environment configs
|
||||
📂 scripts/ # Build and helper scripts
|
||||
📂 src/
|
||||
├─ 📂 agents/ # AI Agent modules
|
||||
├─ 📂 lib/ # Shared libs (DB init, response format)
|
||||
│ ├─ 📂 productionAgent/ # Production Agent
|
||||
│ └─ 📂 scriptAgent/ # Script Agent
|
||||
├─ 📂 lib/ # Common libraries (db, responses)
|
||||
├─ 📂 middleware/ # Middleware
|
||||
├─ 📂 routes/ # Routing modules
|
||||
├─ 📂 routes/ # API routes
|
||||
│ ├─ 📂 agents/ # Agent memory management
|
||||
│ ├─ 📂 artStyle/ # Art style management
|
||||
│ ├─ 📂 assets/ # Asset management
|
||||
│ ├─ 📂 index/ # Home page
|
||||
│ ├─ 📂 assetsGenerate/ # Asset generation
|
||||
│ ├─ 📂 cornerScape/ # Storyboard management
|
||||
│ ├─ 📂 general/ # General APIs
|
||||
│ ├─ 📂 login/ # Auth
|
||||
│ ├─ 📂 migrate/ # Data migration
|
||||
│ ├─ 📂 modelSelect/ # Model selection
|
||||
│ ├─ 📂 novel/ # Novel management
|
||||
│ ├─ 📂 other/ # Other features
|
||||
│ ├─ 📂 outline/ # Outline management
|
||||
│ ├─ 📂 production/ # Production management
|
||||
│ ├─ 📂 project/ # Project management
|
||||
│ ├─ 📂 prompt/ # Prompt management
|
||||
│ ├─ 📂 script/ # Script generation
|
||||
│ ├─ 📂 scriptAgent/ # Script Agent APIs
|
||||
│ ├─ 📂 setting/ # System settings
|
||||
│ ├─ 📂 storyboard/ # Storyboard management
|
||||
│ ├─ 📂 task/ # Task management
|
||||
│ ├─ 📂 user/ # User management
|
||||
│ └─ 📂 video/ # Video generation
|
||||
├─ 📂 types/ # TypeScript type declarations
|
||||
│ └─ 📂 test/ # Test APIs
|
||||
├─ 📂 socket/ # WebSocket comms
|
||||
├─ 📂 types/ # TypeScript types
|
||||
├─ 📂 utils/ # Utility functions
|
||||
├─ 📄 app.ts # App entry point
|
||||
├─ 📄 core.ts # Routing core
|
||||
├─ 📄 env.ts # Env variable handling
|
||||
├─ 📄 core.ts # Core initialization
|
||||
├─ 📄 env.ts # Env vars
|
||||
├─ 📄 err.ts # Error handling
|
||||
├─ 📄 logger.ts # Logging module
|
||||
├─ 📄 router.ts # Route registration
|
||||
└─ 📄 utils.ts # Common tools
|
||||
📂 uploads/ # Uploads
|
||||
📄 LICENSE # License
|
||||
📄 NOTICES.txt # 3rd-party notices
|
||||
└─ 📄 utils.ts # General tools
|
||||
📄 Dockerfile # Docker build config
|
||||
📄 electron-builder.yml # Electron packaging config
|
||||
📄 skillList.json # Skills list
|
||||
📄 LICENSE # (Apache-2.0) License
|
||||
📄 NOTICES.txt # Third-party dependencies
|
||||
📄 package.json # Project config
|
||||
📄 README.md # Project description
|
||||
📄 tsconfig.json # TypeScript config
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
# 🔗 Related Repos
|
||||
# 🔗 Related Repositories
|
||||
|
||||
| Repository | Description | GitHub | Gitee |
|
||||
| ----------------- | ------------------------------------- | -------------------------------------------------- | ------------------------------------------------ |
|
||||
| ---------------- | ---------------------------------- | ------------------------------------------------- | ------------------------------------------------- |
|
||||
| **Toonflow-app** | Full client (this repo, for users) | [GitHub](https://github.com/HBAI-Ltd/Toonflow-app)| [Gitee](https://gitee.com/HBAI-Ltd/Toonflow-app) |
|
||||
| **Toonflow-web** | Frontend source (for devs) | [GitHub](https://github.com/HBAI-Ltd/Toonflow-web) | [Gitee](https://gitee.com/HBAI-Ltd/Toonflow-web) |
|
||||
| **Toonflow-web** | Frontend source (for FE devs) | [GitHub](https://github.com/HBAI-Ltd/Toonflow-web)| [Gitee](https://gitee.com/HBAI-Ltd/Toonflow-web) |
|
||||
|
||||
> 💡 **Tip**: If you just want to use Toonflow, download the client from this repo. The web repo is only for frontend customization/development.
|
||||
> 💡 **Tip:** If you just want to use Toonflow, download the client from this repo directly. The frontend repo is for developers needing secondary dev or UI customization.
|
||||
|
||||
---
|
||||
|
||||
# 📝 Development Roadmap
|
||||
|
||||
We continue to optimize the product. Key focuses for the near future:
|
||||
|
||||
1. Core Function Upgrades
|
||||
|
||||
- `🧩 Prompt Refinement Agent` AI-enhanced prompt generation for videos, auto-parsing storyboards, intelligent multi-shot fusion and smooth transitions
|
||||
- `📄 Multi-format Text Support` Extending to scripts, manga scripts, game dialogue text, and more formats beyond novels
|
||||
|
||||
2. Production Flow Optimization
|
||||
|
||||
- `👗 Character Costume & Props Management` Improved consistency for costumes, makeup, props across long content, support for multi-episode memory and auto costume generation
|
||||
- `📦 Batch Processing/Task Queues` Process multiple chapters at once, backend task management, real-time monitoring and resume-on-interrupt
|
||||
|
||||
3. Visual Generation Enhancement
|
||||
|
||||
- `🎭 Multi-style Template Library` Bundled visual style packs, one-click style swap, user-defined style saving
|
||||
- `⏱️ Intelligent Rhythm Analysis/Optimization` Analyze plot emotional arcs, auto-suggest climaxes and pace changes, optimized storyboard workflow
|
||||
|
||||
---
|
||||
|
||||
# 👨👩👧👦 WeChat Discussion Groups
|
||||
# 👨👩👧👦 WeChat Groups
|
||||
|
||||
~~Group 1~~
|
||||
|
||||
~~Group 2~~
|
||||
|
||||
~~Group 3~~
|
||||
...
|
||||
|
||||
~~Group 4~~
|
||||
~~Group 10~~
|
||||
|
||||
~~Group 5~~
|
||||
~~Group 11~~
|
||||
|
||||
Group 6:
|
||||
~~Group 12~~
|
||||
|
||||
<img src="./chat6QR.jpg" alt="Toonflow Logo" height="400"/>
|
||||
<p>Scan with WeChat to join. If the QR expires, open an issue to request an update.</p>
|
||||
~~Group 13~~
|
||||
|
||||
...
|
||||
|
||||
~~Group 24~~
|
||||
|
||||
Group Assistant:
|
||||
|
||||
<img src="./QR.png" alt="Toonflow QR" height="400"/>
|
||||
|
||||
---
|
||||
|
||||
# 💌 Contact Us
|
||||
|
||||
📧 Email: [ltlctools@outlook.com](mailto:ltlctools@outlook.com?subject=Toonflow%20Inquiry)
|
||||
📧 Email: [ltlctools@outlook.com](mailto:ltlctools@outlook.com?subject=Toonflow inquiry)
|
||||
|
||||
---
|
||||
|
||||
# 📜 License
|
||||
|
||||
Toonflow is open source under the AGPL-3.0 license. Details: https://www.gnu.org/licenses/agpl-3.0.html
|
||||
Toonflow is open source under Apache-2.0 with a supplementary commercial agreement.
|
||||
|
||||
You may use Toonflow for any purpose, including commercial, as long as you adhere to the AGPL-3.0 terms and conditions.
|
||||
License details: https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
For proprietary/commercial licensing exempt from AGPL-3.0, please contact us by email.
|
||||
## Supplementary Agreement
|
||||
|
||||
- If you distribute this software as a product to **2 or more independent third parties**, you must obtain **written commercial authorization** from HBAI-Ltd.
|
||||
- **≤ 5 legal entities** operating jointly for internal use without providing services externally are considered **internal use and require no authorization**.
|
||||
- You may not remove or modify any trademarks, logos, or copyright notices in Toonflow.
|
||||
|
||||
## Always Free — No Authorization Required
|
||||
|
||||
- ✅ Using Toonflow to produce content and earn platform revenue shares
|
||||
- ✅ Secondary development for internal team use
|
||||
- ✅ ≤ 5 legal entities operating jointly, internally only
|
||||
- ✅ Personal learning, research, and non-commercial purposes
|
||||
|
||||
## Licensing Pricing
|
||||
|
||||
| Stage | Annual Revenue | Annual Fee |
|
||||
|------|---------|------|
|
||||
| 🌱 Nurture | < $10k | **Free** |
|
||||
| 🚀 Startup | $10k–$50k | ¥5,000/year |
|
||||
| 📈 Growth | $50k–$150k | ¥20,000/year |
|
||||
| 🏢 Scale | $150k–$500k | ¥80,000/year |
|
||||
| 🌐 Enterprise | > $500k | Negotiable |
|
||||
|
||||
> **Non-Retroactivity Clause**: Users who used Toonflow under AGPL-3.0 prior to the v1.0.8 release are not affected by this change. Their existing usage continues under AGPL-3.0.
|
||||
|
||||
See the full [LICENSE](../LICENSE) file for details.
|
||||
|
||||
---
|
||||
|
||||
# ⭐️ Star History
|
||||
|
||||
[](https://www.star-history.com/#HBAI-Ltd/Toonflow-app&type=date&legend=top-left)
|
||||
[](https://www.star-history.com/#HBAI-Ltd/Toonflow-app&type=timeline&legend=top-left)
|
||||
|
||||
---
|
||||
|
||||
# 🙏 Special Thanks
|
||||
# 🙏 Thanks
|
||||
|
||||
Thanks to the following open-source projects for empowering Toonflow:
|
||||
Thank you to the following open-source projects for supporting Toonflow:
|
||||
|
||||
- [Express](https://expressjs.com/) – Fast, open, minimal Node.js web framework
|
||||
- [LangChain](https://js.langchain.com/) – Framework for building LLM apps
|
||||
- [Better-SQLite3](https://github.com/WiseLibs/better-sqlite3) – High-performance SQLite3 bindings
|
||||
- [Sharp](https://sharp.pixelplumbing.com/) – High-performance Node.js image processing
|
||||
- [Axios](https://axios-http.com/) – Promise-based HTTP client
|
||||
- [Zod](https://zod.dev/) – TypeScript-first schema validation
|
||||
- [Aigne](https://github.com/aigne-com/aigne) – Unified LLM API middleware
|
||||
- [Electron](https://www.electronjs.org/) – Cross-platform desktop app framework
|
||||
- [Express](https://expressjs.com/) - Fast, open, minimalist Node.js Web framework
|
||||
- [AI SDK](https://ai-sdk.dev/) - TypeScript-first AI toolkit
|
||||
- [Better-SQLite3](https://github.com/WiseLibs/better-sqlite3) - High-performance SQLite3 bindings
|
||||
- [Sharp](https://sharp.pixelplumbing.com/) - High-performance Node.js image toolkit
|
||||
- [Axios](https://axios-http.com/) - Promise-based HTTP client
|
||||
- [Zod](https://zod.dev/) - TypeScript-first schema validation library
|
||||
- [Socket.IO](https://socket.io/) - Real-time bidirectional event framework
|
||||
- [Electron](https://www.electronjs.org/) - Cross-platform desktop app framework
|
||||
- [Hugging Face Transformers](https://huggingface.co./transformers.js) - Local ML inference library
|
||||
|
||||
Thanks to the following organizations/individuals for supporting Toonflow:
|
||||
Thanks to the following organizations/individuals for their support:
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="./sponsored/sophnet.png" alt="Sophnet Cloud Logo" width="48">
|
||||
<img src="./sponsored/sophnet.png" alt="SophNet Logo" width="48">
|
||||
</td>
|
||||
<td>
|
||||
<b>Sophnet Cloud</b> provided compute sponsorship
|
||||
<a href="https://www.sophnet.com/">[Official Site]</a>
|
||||
<b>SophNet Cloud</b> provides computing power sponsorship
|
||||
<a href="https://www.sophnet.com/">[Official Website]</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
For the full list of third-party dependencies, see `NOTICES.txt`
|
||||
For a complete list of third-party dependencies, see `NOTICES.txt`
|
||||
|
||||
|
||||
590
docs/README.ja.md
Normal file
@ -0,0 +1,590 @@
|
||||
<p>
|
||||
<a href="https://github.com/HBAI-Ltd/Toonflow-app">
|
||||
<img src="https://img.shields.io/badge/GitHub-181717?style=flat-square&logo=github&logoColor=white" alt="GitHub" />
|
||||
</a>
|
||||
|
|
||||
<a href="https://gitee.com/HBAI-Ltd/Toonflow-app">
|
||||
<img src="https://img.shields.io/badge/Gitee-C71D23?style=flat-square&logo=gitee&logoColor=white" alt="Gitee" />
|
||||
</a>
|
||||
|
|
||||
<a href="https://gitcode.com/HBAI-Ltd/Toonflow-app">
|
||||
<img src="./atomgitLogo.png" alt="Atomgit" style="height:16px"/>
|
||||
Atomgit
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="/README.md">簡体字中国語</a> |
|
||||
<a href="./README.zhtw.md">繁体字中国語</a> |
|
||||
<a href="./README.en.md">英語</a> |
|
||||
<a href="./README.th.md">タイ語</a> |
|
||||
<a href="./README.vi.md">ベトナム語</a> |
|
||||
<strong>日本語</strong> |
|
||||
<a href="./README.ru.md">ロシア語</a>
|
||||
</p>
|
||||
|
||||
<div align="center">
|
||||
|
||||
<img src="./logo.png" alt="Toonflow Logo" height="120"/>
|
||||
|
||||
# Toonflow
|
||||
|
||||
<p align="center">
|
||||
<b>
|
||||
AI短編ドラマ工場
|
||||
<br />
|
||||
指先ひとつで、小説が瞬時にドラマ化!
|
||||
<br />
|
||||
AI脚本 × AI映像 × 超高速生成 🔥
|
||||
</b>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://github.com/HBAI-Ltd/Toonflow-app/stargazers">
|
||||
<img src="https://img.shields.io/github/stars/HBAI-Ltd/Toonflow-app?style=for-the-badge&logo=github" alt="Stars Badge" />
|
||||
</a>
|
||||
<a href="https://www.apache.org/licenses/LICENSE-2.0" target="_blank">
|
||||
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=for-the-badge" alt="Apache-2.0 License Badge" />
|
||||
</a>
|
||||
<a href="https://github.com/HBAI-Ltd/Toonflow-app/releases">
|
||||
<img alt="release" src="https://img.shields.io/github/v/release/HBAI-Ltd/Toonflow-app?style=for-the-badge" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
> 🚀 **ワンストップ短編ドラマ制作**:テキストからキャラクター、絵コンテ、映像まで、0知識でAI化された全プロセス。創作効率10倍以上!
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
# 🌟 主な機能
|
||||
|
||||
ToonflowはAI短編漫画/ドラマ制作ツールで、小説をAIが自動的に脚本化し、AI生成画像・映像と組み合わせて高効率な短編ドラマ制作を実現します。Toonflowにより、テキストから映像までの流れを簡単に完結でき、短編ドラマ制作がよりスマート&便利になります。
|
||||
|
||||
- ✅ **キャラクター生成**
|
||||
元の小説テキストを自動分析し、外見・性格・身分など詳細なキャラクター設定をスマートに識別・生成。脚本・作画の基盤を提供します。
|
||||
- ✅ **脚本生成**
|
||||
選択したエピソードや章に基づき、構造化された脚本(セリフ・シーン描写・ストーリー展開など)をシステムが自動生成。小説から映像脚本への効率的な変換を実現します。
|
||||
- ✅ **絵コンテ作成**
|
||||
脚本内容に基づき、AIが適切な絵コンテプロンプトや画面設計を生成。前景・中景・背景、キャラクター動作、小道具設計、場面レイアウトを細分化し、脚本からビデオへの完全なルートマップを自動構築します。
|
||||
- ✅ **動画合成**
|
||||
AI画像と動画技術を統合し、AI生成により映像クリップの作成が可能。オンライン編集と個別調整にも対応し、映像創作の効率アップ&迅速実現をサポートします。
|
||||
|
||||
---
|
||||
|
||||
# 📦 利用シーン
|
||||
|
||||
- ショート動画コンテンツ制作
|
||||
- 小説の映像化実験
|
||||
- AI文学改編ツール
|
||||
- 脚本開発&高速プロトタイピング
|
||||
- 動画素材生成
|
||||
|
||||
---
|
||||
|
||||
# 🔰 使い方ガイド
|
||||
|
||||
## 📺 動画チュートリアル
|
||||
|
||||
https://www.bilibili.com/video/BV1na6wB6Ea2
|
||||
[](https://www.bilibili.com/video/BV1na6wB6Ea2)
|
||||
|
||||
**Toonflow 8分クイックスタートAI動画**
|
||||
👉 [クリックして見る](https://www.bilibili.com/video/BV1na6wB6Ea2/?share_source=copy_web&vd_source=5b718c25439a901a34c7bc0c1d35b38e)
|
||||
|
||||
📱 スマホWeChatでQRコードをスキャンして視聴
|
||||
|
||||
<img src="./videoQR.png" alt="微信扫码观看" width="150"/>
|
||||
|
||||
---
|
||||
|
||||
# 🚀 インストール
|
||||
|
||||
## 前提条件
|
||||
|
||||
本ソフトウェアのインストール・利用前に以下をご用意ください:
|
||||
|
||||
- ✅ 大規模言語モデルAIサービスのエンドポイント
|
||||
- ✅ SoraまたはDoubao動画サービスAPI
|
||||
- ✅ Nano Banana Pro画像生成モデルAPI
|
||||
|
||||
## ローカルインストール
|
||||
|
||||
### 1. ダウンロード&インストール
|
||||
|
||||
| OS | GitHubダウンロード | Quark(夸克)クラウドダウンロード | 説明 |
|
||||
| :--------: | :----------------------------------------------------- | :---------------------------------------------- | :--------------- |
|
||||
| Windows | [Release](https://github.com/HBAI-Ltd/Toonflow-app/releases) | [夸克クラウド](https://pan.quark.cn/s/94ef07509df0) | 公式配布インストーラ |
|
||||
| Linux | [Release](https://github.com/HBAI-Ltd/Toonflow-app/releases) | [夸克クラウド](https://pan.quark.cn/s/94ef07509df0) | 公式配布インストーラ |
|
||||
| macOS | [Release](https://github.com/HBAI-Ltd/Toonflow-app/releases) | [夸克クラウド](https://pan.quark.cn/s/94ef07509df0) | 公式配布インストーラ |
|
||||
|
||||
> [!CAUTION]
|
||||
> MacOSの場合は、設定→プライバシーとセキュリティでセキュリティ設定を許可してください。証明書問題でアプリが開かない場合があります。
|
||||
>
|
||||
> 参考:知乎ドキュメント:[https://www.zhihu.com/question/433389276](https://www.zhihu.com/question/433389276)
|
||||
|
||||
> Gitee OSの制限とReleaseファイルのサイズ上限により、Gitee側のReleaseダウンロードは現在未提供です。
|
||||
|
||||
### 2. サービス起動
|
||||
|
||||
インストール後、アプリを起動してください。
|
||||
|
||||
> ⚠️ **初回ログイン**
|
||||
> アカウント:`admin`
|
||||
> パスワード:`admin123`
|
||||
|
||||
## Dockerデプロイ
|
||||
|
||||
### 前提条件
|
||||
|
||||
- [Docker](https://docs.docker.com/get-docker/)(バージョン 20.10以上)インストール済み
|
||||
|
||||
### 方法1:オンラインデプロイ
|
||||
|
||||
現在準備中。しばらくはローカルビルドをご利用ください。
|
||||
|
||||
### 方法2:ローカルビルド
|
||||
|
||||
お手持ちのソースコードから直接ビルド。開発者またはリポジトリクローン済ユーザー向け(git要インストール)。
|
||||
|
||||
```shell
|
||||
# まずプロジェクトをクローン(既にある場合は省略可)
|
||||
git clone https://github.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
|
||||
# docker-composeでローカルビルド&起動
|
||||
yarn docker:local
|
||||
|
||||
# または手動ビルド
|
||||
docker build -t toonflow .
|
||||
docker run -d -p <ローカルポート>:10588 -v <ローカルデータパス>:/app/data toonflow
|
||||
|
||||
# 指定ポートの /web/index.html でアクセス可
|
||||
# 例)http://localhost:10588/web/index.html
|
||||
```
|
||||
|
||||
### サービスポート情報
|
||||
|
||||
| ポート | 用途 | デプロイマッピング |
|
||||
| ------- | -------- | ------------- |
|
||||
| `10588` | UI | `10588:10588` |
|
||||
|
||||
**環境変数メモ:**
|
||||
|
||||
| 変数 | 説明 |
|
||||
| ------------ | -------------------------- |
|
||||
| `NODE_ENV` | 実行環境、`prod`が本番 |
|
||||
| `PORT` | サービスポート(デフォルト10588) |
|
||||
| `OSSURL` | ファイル保存URL(静的リソース) |
|
||||
|
||||
---
|
||||
|
||||
## クラウドデプロイ
|
||||
|
||||
### 1. サーバー環境要件
|
||||
|
||||
- **OS**:Ubuntu 20.04以上/CentOS 7以上
|
||||
- **Node.js**:24.x(推奨、最低23.11.1以上)
|
||||
- **メモリ**:2GB以上
|
||||
|
||||
### 2. サーバーデプロイ
|
||||
|
||||
#### 1. 環境インストール
|
||||
|
||||
```bash
|
||||
# Node.jsインストール
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
||||
source ~/.bashrc
|
||||
nvm install 24
|
||||
# YarnとPM2インストール
|
||||
npm install -g yarn pm2
|
||||
```
|
||||
|
||||
#### 2. プロジェクト導入
|
||||
|
||||
**GitHubからクローン:**
|
||||
|
||||
```bash
|
||||
cd /opt
|
||||
git clone https://github.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
yarn install
|
||||
yarn build
|
||||
```
|
||||
|
||||
**Giteeからクローン(中国国内推奨):**
|
||||
|
||||
```bash
|
||||
cd /opt
|
||||
git clone https://gitee.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
yarn install
|
||||
yarn build
|
||||
```
|
||||
|
||||
#### 3. PM2構成
|
||||
|
||||
`pm2.json`ファイルを作成:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "toonflow-app",
|
||||
"script": "data/serve/app.js",
|
||||
"instances": "max",
|
||||
"exec_mode": "cluster",
|
||||
"env": {
|
||||
"NODE_ENV": "prod",
|
||||
"PORT": 10588,
|
||||
"OSSURL": "http://127.0.0.1:10588/"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**環境変数説明:**
|
||||
|
||||
| 変数 | 説明 |
|
||||
| ------------ | -------------------------- |
|
||||
| `NODE_ENV` | 実行環境、`prod`が本番 |
|
||||
| `PORT` | サービスポート |
|
||||
| `OSSURL` | ファイル保存URL(静的リソース) |
|
||||
|
||||
---
|
||||
|
||||
#### 4. サービス起動
|
||||
|
||||
```bash
|
||||
pm2 start pm2.json
|
||||
pm2 startup
|
||||
pm2 save
|
||||
```
|
||||
|
||||
#### 5. よく使うコマンド
|
||||
|
||||
```bash
|
||||
pm2 list # プロセス一覧
|
||||
pm2 logs toonflow-app # ログを見る
|
||||
pm2 restart all # サービス再起動
|
||||
pm2 monit # 監視パネル
|
||||
```
|
||||
|
||||
> ⚠️ **初回ログイン**
|
||||
> アカウント:`admin`
|
||||
> パスワード:`admin123`
|
||||
|
||||
#### 6. フロントエンドのデプロイ
|
||||
|
||||
前端の分離デプロイやカスタマイズが必要な場合はこちら:
|
||||
|
||||
- **GitHub**:[Toonflow-web](https://github.com/HBAI-Ltd/Toonflow-web)
|
||||
- **Gitee**:[Toonflow-web](https://gitee.com/HBAI-Ltd/Toonflow-web)
|
||||
|
||||
> 💡 **補足**:このリポジトリにはビルド済のフロントリソースが内蔵済み。通常ユーザーはフロント分離構築は不要。フロントリポジトリはカスタム開発用です。
|
||||
|
||||
---
|
||||
|
||||
# 🔧 開発フローガイド
|
||||
|
||||
> [!CAUTION]
|
||||
> 🚧 **PR提出ガイドライン** 🚧
|
||||
>
|
||||
> ⛔ `master`ブランチはPR不可 | ✅ `develop`ブランチにPR提出
|
||||
>
|
||||
> 開発者のご参加を歓迎します。参加希望はコミュニティで主催者ACTにご連絡ください。
|
||||
|
||||
## 🛠️ 技術スタック
|
||||
|
||||
| カテゴリ | 技術 |
|
||||
| -------------- | ---------------------------------------------------------------------------------------- |
|
||||
| ランタイム | Node.js 23.11.1+ |
|
||||
| 言語 | TypeScript 5.x |
|
||||
| バックエンド | Express 5 |
|
||||
| データベース | SQLite(better-sqlite3 / knex) |
|
||||
| AI連携 | Vercel AI SDK(OpenAI / Anthropic / Google / DeepSeek / 智谱 / MiniMax / 通義千問 / xAI) |
|
||||
| ローカル推論 | @huggingface/transformers(ONNX) |
|
||||
| リアルタイム通信 | Socket.IO |
|
||||
| デスクトップ | Electron 40 |
|
||||
| 画像処理 | Sharp |
|
||||
| コンテナ化 | Docker |
|
||||
|
||||
## 開発環境準備
|
||||
|
||||
- **Node.js**:バージョン23.11.1以上
|
||||
- **Yarn**:パッケージマネージャ推奨
|
||||
|
||||
## プロジェクトのクイック起動
|
||||
|
||||
1. **プロジェクトクローン**
|
||||
|
||||
**GitHubからクローン:**
|
||||
|
||||
```bash
|
||||
git clone https://github.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
```
|
||||
|
||||
**Giteeからクローン(中国国内推奨):**
|
||||
|
||||
```bash
|
||||
git clone https://gitee.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
```
|
||||
|
||||
2. **依存パッケージインストール**
|
||||
|
||||
プロジェクト直下で次を実行:
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
3. **開発環境の起動**
|
||||
|
||||
本プロジェクトは**バックエンドAPIサービス**と**フロントエンド**があります。次から用途を選択。
|
||||
|
||||
- **方法1:バックエンドのみ起動**
|
||||
|
||||
```bash
|
||||
yarn dev
|
||||
```
|
||||
|
||||
> ⚠️ このコマンドはAPIサーバー(ポート10588)のみ起動。`http://localhost:10588`でAPIのみ利用。GUI表示にはフロントプロジェクトの起動または下記のGUIモードをご利用ください。
|
||||
|
||||
- **方法2:Electronデスクトップクライアント**
|
||||
|
||||
```bash
|
||||
yarn dev:gui
|
||||
```
|
||||
|
||||
> バックエンドとElectronウィンドウが同時起動。内蔵フロント付きで即利用OK。すべての機能を体験したい方向け。
|
||||
|
||||
- **方法3:本番モードで起動**
|
||||
|
||||
```bash
|
||||
yarn start
|
||||
```
|
||||
|
||||
> 本番モードでビルド済サービスを直接起動(`yarn build`が必要)。
|
||||
|
||||
4. **プロジェクトパッケージ化**
|
||||
|
||||
- TypeScriptファイルのビルド:
|
||||
|
||||
```bash
|
||||
yarn build
|
||||
```
|
||||
|
||||
- Windows用実行ファイル化:
|
||||
|
||||
```bash
|
||||
yarn dist:win
|
||||
```
|
||||
|
||||
- Mac用実行ファイル化:
|
||||
|
||||
```bash
|
||||
yarn dist:mac
|
||||
```
|
||||
|
||||
- Linux用実行ファイル化:
|
||||
|
||||
```bash
|
||||
yarn dist:linux
|
||||
```
|
||||
|
||||
5. **コード品質チェック**
|
||||
|
||||
- グローバルLintチェック:
|
||||
|
||||
```bash
|
||||
yarn lint
|
||||
```
|
||||
|
||||
6. **AIデバッグパネル(任意)**
|
||||
|
||||
AI SDKのGUIデバッグツール。AI呼び出しのデバッグに便利。
|
||||
|
||||
```bash
|
||||
yarn debug:ai
|
||||
```
|
||||
|
||||
## フロントエンド開発
|
||||
|
||||
フロントUIの修正はフロントエンドリポジトリへ:
|
||||
|
||||
- **GitHub**:[Toonflow-web](https://github.com/HBAI-Ltd/Toonflow-web)
|
||||
- **Gitee**:[Toonflow-web](https://gitee.com/HBAI-Ltd/Toonflow-web)
|
||||
|
||||
ビルド後、`dist`以下を本プロジェクト `data/web`へコピーで統合完了。
|
||||
|
||||
## プロジェクト構成
|
||||
|
||||
```
|
||||
📂 build/ # ビルド成果物
|
||||
📂 data/ # 実行時データ
|
||||
│ ├─ 📂 models/ # ローカル推論モデル(ONNX)
|
||||
│ ├─ 📂 oss/ # オブジェクトストレージ(素材/キャラ/背景)
|
||||
│ ├─ 📂 serve/ # 本番エントリ
|
||||
│ ├─ 📂 skills/ # Agentプロンプト集
|
||||
│ └─ 📂 web/ # ビルトインフロント
|
||||
📂 docs/ # ドキュメントリソース
|
||||
📂 env/ # 環境設定
|
||||
📂 scripts/ # ビルド&ツールスクリプト
|
||||
📂 src/
|
||||
├─ 📂 agents/ # AI Agentモジュール
|
||||
│ ├─ 📂 productionAgent/ # プロダクション用Agent
|
||||
│ └─ 📂 scriptAgent/ # 脚本Agent
|
||||
├─ 📂 lib/ # 共通ライブラリ(DB初期化等)
|
||||
├─ 📂 middleware/ # ミドルウェア
|
||||
├─ 📂 routes/ # ルーティングモジュール
|
||||
│ ├─ 📂 agents/ # Agentメモリ管理
|
||||
│ ├─ 📂 artStyle/ # 画風管理
|
||||
│ ├─ 📂 assets/ # 素材管理
|
||||
│ ├─ 📂 assetsGenerate/ # 素材生成
|
||||
│ ├─ 📂 cornerScape/ # 絵コンテ管理
|
||||
│ ├─ 📂 general/ # 共通API
|
||||
│ ├─ 📂 login/ # ログイン認証
|
||||
│ ├─ 📂 migrate/ # データ移行
|
||||
│ ├─ 📂 modelSelect/ # モデル選択
|
||||
│ ├─ 📂 novel/ # 小説管理
|
||||
│ ├─ 📂 other/ # その他機能
|
||||
│ ├─ 📂 production/ # 制作管理
|
||||
│ ├─ 📂 project/ # プロジェクト管理
|
||||
│ ├─ 📂 script/ # 脚本生成
|
||||
│ ├─ 📂 scriptAgent/ # 脚本AgentAPI
|
||||
│ ├─ 📂 setting/ # システム設定
|
||||
│ ├─ 📂 task/ # タスク管理
|
||||
│ └─ 📂 test/ # テストAPI
|
||||
├─ 📂 socket/ # WebSocket通信
|
||||
├─ 📂 types/ # TypeScript型
|
||||
├─ 📂 utils/ # ユーティリティ
|
||||
├─ 📄 app.ts # アプリエントリ
|
||||
├─ 📄 core.ts # コア初期化
|
||||
├─ 📄 env.ts # 環境変数処理
|
||||
├─ 📄 err.ts # エラーハンドラ
|
||||
├─ 📄 logger.ts # ロギング
|
||||
├─ 📄 router.ts # ルート登録
|
||||
└─ 📄 utils.ts # 共通ツール
|
||||
📄 Dockerfile # Dockerビルド
|
||||
📄 electron-builder.yml # Electronパッケージ設定
|
||||
📄 skillList.json # スキルリスト
|
||||
📄 LICENSE # ライセンス(Apache-2.0)
|
||||
📄 NOTICES.txt # サードパーティ依存リスト
|
||||
📄 package.json # プロジェクト設定
|
||||
📄 tsconfig.json # TypeScript設定
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
# 🔗 関連リポジトリ
|
||||
|
||||
| リポジトリ | 説明 | GitHub | Gitee |
|
||||
| ------------------ | ---------------------------------- | -------------------------------------------------- | ------------------------------------------------ |
|
||||
| **Toonflow-app** | フルクライアント(本リポジトリ、一般ユーザー向け) | [GitHub](https://github.com/HBAI-Ltd/Toonflow-app) | [Gitee](https://gitee.com/HBAI-Ltd/Toonflow-app) |
|
||||
| **Toonflow-web** | フロントエンドソース(フロントエンド開発者向け) | [GitHub](https://github.com/HBAI-Ltd/Toonflow-web) | [Gitee](https://gitee.com/HBAI-Ltd/Toonflow-web) |
|
||||
|
||||
> 💡 **ヒント**:Toonflowを利用したいだけなら本リポジトリをそのままダウンロードすればOK。フロントリポジトリはフロントカスタマイズや2次開発者向けです。
|
||||
|
||||
---
|
||||
|
||||
# 👨👩👧👦 WeChatコミュニティグループ
|
||||
|
||||
~~グループ1~~
|
||||
|
||||
~~グループ2~~
|
||||
|
||||
...
|
||||
|
||||
~~グループ10~~
|
||||
|
||||
~~グループ11~~
|
||||
|
||||
~~グループ12~~
|
||||
|
||||
~~グループ13~~
|
||||
|
||||
...
|
||||
|
||||
~~グループ24~~
|
||||
|
||||
グループ招待アシスタント:
|
||||
|
||||
<img src="./QR.png" alt="Toonflow QR" height="400"/>
|
||||
|
||||
---
|
||||
|
||||
# 💌 お問い合わせ
|
||||
|
||||
📧 メール:[ltlctools@outlook.com](mailto:ltlctools@outlook.com?subject=Toonflow相談)
|
||||
|
||||
---
|
||||
|
||||
# 📜 ライセンス
|
||||
|
||||
ToonflowはApache-2.0ライセンス+補足商業契約でオープンソース公開されています。
|
||||
|
||||
ライセンス詳細:https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
## 補足契約
|
||||
|
||||
- 本ソフトウェアを製品として**2つ以上の独立した第三者**に配布する場合、HBAI-Ltdの**書面による商業許諾**が必要です。
|
||||
- **5法人以下**の共同運営で内部利用のみの場合は、**商業許諾不要**です。
|
||||
- Toonflowの商標・ロゴ・著作権情報の削除・改変は禁止です。
|
||||
|
||||
## 永久無料シーン
|
||||
|
||||
- ✅ Toonflowでコンテンツを制作しプラットフォーム収益を得る
|
||||
- ✅ 自チーム内部利用の二次開発
|
||||
- ✅ ≤ 5法人の共同運営内部利用
|
||||
- ✅ 個人学習・研究・非商用利用
|
||||
|
||||
## 商業ライセンス価格
|
||||
|
||||
| 段階 | 年間売上高 | 年間費用 |
|
||||
|------|---------|------|
|
||||
| 🌱 育成期 | < ¥10万 | **無料** |
|
||||
| 🚀 スタートアップ | ¥10〜50万 | ¥5,000/年 |
|
||||
| 📈 成長期 | ¥50〜150万 | ¥20,000/年 |
|
||||
| 🏢 拡大期 | ¥150〜500万 | ¥80,000/年 |
|
||||
| 🌐 エンタープライズ | > ¥500万 | 要相談 |
|
||||
|
||||
> **不遡及条項**:v1.0.8リリース前にAGPL-3.0でToonflowを使用していたユーザーは、本変更の影響を受けません。既存の利用はAGPL-3.0に基づき継続されます。
|
||||
|
||||
完全な契約内容は [LICENSE](../LICENSE) をご覧ください。
|
||||
|
||||
---
|
||||
|
||||
# ⭐️ スター履歴
|
||||
|
||||
[](https://www.star-history.com/#HBAI-Ltd/Toonflow-app&type=timeline&legend=top-left)
|
||||
|
||||
---
|
||||
|
||||
# 🙏 謝辞
|
||||
|
||||
以下のオープンソースプロジェクトの強力な支援に感謝します:
|
||||
|
||||
- [Express](https://expressjs.com/) - 高速・オープンなNode.js Webフレームワーク
|
||||
- [AI SDK](https://ai-sdk.dev/) - TypeScript向けAIツールキット
|
||||
- [Better-SQLite3](https://github.com/WiseLibs/better-sqlite3) - 高性能SQLite3バインディング
|
||||
- [Sharp](https://sharp.pixelplumbing.com/) - 高速Node.js画像処理
|
||||
- [Axios](https://axios-http.com/) - PromiseベースHTTPクライアント
|
||||
- [Zod](https://zod.dev/) - TypeScript優先のバリデーション
|
||||
- [Socket.IO](https://socket.io/) - リアルタイム双方向通信エンジン
|
||||
- [Electron](https://www.electronjs.org/) - クロスプラットフォームデスクトップ開発
|
||||
- [Hugging Face Transformers](https://huggingface.co/docs/transformers.js) - ローカル機械学習推論ライブラリ
|
||||
|
||||
以下の組織・団体・個人によるToonflowへの協力に感謝します:
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="./sponsored/sophnet.png" alt="算能云 Logo" width="48">
|
||||
</td>
|
||||
<td>
|
||||
<b>算能云</b> よりコンピューティング協賛
|
||||
<a href="https://www.sophnet.com/">[公式サイト]</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
第三者依存リストは `NOTICES.txt` をご覧ください
|
||||
|
||||
</translate_input>
|
||||
588
docs/README.ru.md
Normal file
@ -0,0 +1,588 @@
|
||||
<p>
|
||||
<a href="https://github.com/HBAI-Ltd/Toonflow-app">
|
||||
<img src="https://img.shields.io/badge/GitHub-181717?style=flat-square&logo=github&logoColor=white" alt="GitHub" />
|
||||
</a>
|
||||
|
|
||||
<a href="https://gitee.com/HBAI-Ltd/Toonflow-app">
|
||||
<img src="https://img.shields.io/badge/Gitee-C71D23?style=flat-square&logo=gitee&logoColor=white" alt="Gitee" />
|
||||
</a>
|
||||
|
|
||||
<a href="https://gitcode.com/HBAI-Ltd/Toonflow-app">
|
||||
<img src="./atomgitLogo.png" alt="Atomgit" style="height:16px"/>
|
||||
Atomgit
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="/README.md">简体中文</a> |
|
||||
<a href="./README.zhtw.md">繁體中文</a> |
|
||||
<a href="./README.en.md">English</a> |
|
||||
<a href="./README.th.md">ไทย</a> |
|
||||
<a href="./README.vi.md">Tiếng Việt</a> |
|
||||
<a href="./README.ja.md">日本語</a> |
|
||||
<strong>Русский</strong>
|
||||
</p>
|
||||
|
||||
<div align="center">
|
||||
|
||||
<img src="./logo.png" alt="Toonflow Logo" height="120"/>
|
||||
|
||||
# Toonflow
|
||||
|
||||
<p align="center">
|
||||
<b>
|
||||
AI-фабрика коротких сериалов
|
||||
<br />
|
||||
Одним движением — роман за секунду становится сериалом!
|
||||
<br />
|
||||
AI-сценарий × AI-изображения × Молниеносная генерация 🔥
|
||||
</b>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://github.com/HBAI-Ltd/Toonflow-app/stargazers">
|
||||
<img src="https://img.shields.io/github/stars/HBAI-Ltd/Toonflow-app?style=for-the-badge&logo=github" alt="Stars Badge" />
|
||||
</a>
|
||||
<a href="https://www.apache.org/licenses/LICENSE-2.0" target="_blank">
|
||||
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=for-the-badge" alt="Apache-2.0 License Badge" />
|
||||
</a>
|
||||
<a href="https://github.com/HBAI-Ltd/Toonflow-app/releases">
|
||||
<img alt="release" src="https://img.shields.io/github/v/release/HBAI-Ltd/Toonflow-app?style=for-the-badge" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
> 🚀 **Универсальный конвейер коротких сериалов**: от текста к персонажам, от раскадровки к видео, 0 порога по всему процессу на базе AI, рост эффективности творчества 10× и более!
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
# 🌟 Основные функции
|
||||
|
||||
Toonflow — инструмент для создания коротких сериалов и комиксов с помощью AI, позволяющий автоматически превращать романы в сценарии и генерировать изображения и видео с помощью нейросетей. Используя Toonflow, вы легко пройдёте путь от текста к видео: создание коротких фильмов становится умнее и удобнее.
|
||||
|
||||
- ✅ **Генерация персонажей**
|
||||
Автоматически анализирует исходный текст романа, интеллектуально идентифицирует и генерирует параметры персонажей, включая внешний вид, характер, социальный статус и др., формируя прочную основу для дальнейшей разработки сценария и визуала.
|
||||
- ✅ **Генерация сценария**
|
||||
На основе выбранных событий и глав система автоматически создает структурированный сценарий, включая диалоги, описание сцен и развитие сюжета, обеспечивая эффективную трансформацию из литературного текста в кинематографический сценарий.
|
||||
- ✅ **Раскадровка**
|
||||
На основе сценария AI генерирует креативные промпты и дизайн кадров, прорабатывает передний-средний-задний план, динамику персонажей, реквизит и компоновку сцен, автоматически создаёт раскадровку для дальнейшей видеосборки.
|
||||
- ✅ **Видеосборка**
|
||||
Интегрирует AI-технологии генерации изображений и видео. Позволяет создавать фрагменты видео с помощью ИИ. Системы онлайн-редактирования поддерживают индивидуальные настройки и быстрый вывод конечного результата.
|
||||
|
||||
---
|
||||
|
||||
# 📦 Области применения
|
||||
|
||||
- Создание коротких видео-контента
|
||||
- Эксперименты по экранизации романов
|
||||
- Инструмент AI для литературных адаптаций
|
||||
- Разработка сценариев и быстрые прототипы
|
||||
- Генерация видеоматериалов
|
||||
|
||||
---
|
||||
|
||||
# 🔰 Руководство пользователя
|
||||
|
||||
## 📺 Видеоруководство
|
||||
|
||||
https://www.bilibili.com/video/BV1na6wB6Ea2
|
||||
[](https://www.bilibili.com/video/BV1na6wB6Ea2)
|
||||
|
||||
**Toonflow: 8 минут до полного освоения AI-видео**
|
||||
👉 [Смотреть видео](https://www.bilibili.com/video/BV1na6wB6Ea2/?share_source=copy_web&vd_source=5b718c25439a901a34c7bc0c1d35b38e)
|
||||
|
||||
📱 Сканируйте WeChat QR-код для просмотра на телефоне
|
||||
|
||||
<img src="./videoQR.png" alt="微信扫码观看" width="150"/>
|
||||
|
||||
---
|
||||
|
||||
# 🚀 Установка
|
||||
|
||||
## Предварительные требования
|
||||
|
||||
Перед установкой и использованием программы подготовьте следующее:
|
||||
|
||||
- ✅ Адрес API сервиса языковой AI-модели
|
||||
- ✅ Адрес API Sora или Doubao для видео
|
||||
- ✅ Адрес API сервиса модели Nano Banana Pro для генерации изображений
|
||||
|
||||
## Установка локально
|
||||
|
||||
### 1. Скачивание и установка
|
||||
|
||||
| Операционная система | Скачать с GitHub | Скачать с Quark Disk | Примечание |
|
||||
| :------------------: | :------------------------------------------------------- | :------------------------------------------------- | :----------------------- |
|
||||
| Windows | [Release](https://github.com/HBAI-Ltd/Toonflow-app/releases) | [Quark Disk](https://pan.quark.cn/s/94ef07509df0) | Официальный установщик |
|
||||
| Linux | [Release](https://github.com/HBAI-Ltd/Toonflow-app/releases) | [Quark Disk](https://pan.quark.cn/s/94ef07509df0) | Официальный установщик |
|
||||
| macOS | [Release](https://github.com/HBAI-Ltd/Toonflow-app/releases) | [Quark Disk](https://pan.quark.cn/s/94ef07509df0) | Официальный установщик |
|
||||
|
||||
> [!CAUTION]
|
||||
> Для macOS: откройте "Настройки → Конфиденциальность и безопасность" и настройте параметры безопасности, иначе может не открыться из-за проблемы с сертификатом.
|
||||
>
|
||||
> См. на Zhihu: [https://www.zhihu.com/question/433389276](https://www.zhihu.com/question/433389276)
|
||||
|
||||
> Из-за ограничений Gitee OS и лимита по размеру файлов Release — отдельная ссылка для загрузки с Gitee временно недоступна.
|
||||
|
||||
### 2. Запуск сервиса
|
||||
|
||||
После установки запустите приложение для начала работы.
|
||||
|
||||
> ⚠️ **Первый вход**
|
||||
> Логин: `admin`
|
||||
> Пароль: `admin123`
|
||||
|
||||
## Развертывание через Docker
|
||||
|
||||
### Предварительные требования
|
||||
|
||||
- Установлен [Docker](https://docs.docker.com/get-docker/) (версия 20.10+)
|
||||
|
||||
### Способ 1: Онлайн-развертывание
|
||||
|
||||
В разработке — пока используйте локальную сборку.
|
||||
|
||||
### Способ 2: Локальная сборка
|
||||
|
||||
Собирается локально из скачанного репозитория, подходит для разработчиков либо скачавших код через git:
|
||||
|
||||
```shell
|
||||
# Клонировать проект (если уже есть — пропустите)
|
||||
git clone https://github.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
|
||||
# Запускаем сборку и запуск с помощью docker-compose
|
||||
yarn docker:local
|
||||
|
||||
# Или вручную
|
||||
docker build -t toonflow .
|
||||
docker run -d -p <локальный_порт>:10588 -v <путь_к_данным>:/app/data toonflow
|
||||
|
||||
# Доступ по адресу: http://localhost:10588/web/index.html
|
||||
```
|
||||
|
||||
### Описание портов
|
||||
|
||||
| Порт | Назначение | Мэппинг в контейнере |
|
||||
| -------- | ------------- | ---------------------------- |
|
||||
| `10588` | Web-интерфейс | `10588:10588` |
|
||||
|
||||
**Переменные окружения:**
|
||||
|
||||
| Переменная | Описание |
|
||||
| ------------ | --------------------------------------- |
|
||||
| `NODE_ENV` | Среда запуска, `prod` — продуктивная |
|
||||
| `PORT` | Порт службы (по умолчанию 10588) |
|
||||
| `OSSURL` | Доступ к хранилищу файлов, для статики |
|
||||
|
||||
---
|
||||
|
||||
## Развёртывание в облаке
|
||||
|
||||
### 1. Требования к серверу
|
||||
|
||||
- **ОС**: Ubuntu 20.04+ / CentOS 7+
|
||||
- **Node.js**: 24.x (рекомендуется; минимум 23.11.1+)
|
||||
- **ОЗУ**: от 2 ГБ
|
||||
|
||||
### 2. Развёртывание на сервере
|
||||
|
||||
#### 1. Установка окружения
|
||||
|
||||
```bash
|
||||
# Установка Node.js
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
||||
source ~/.bashrc
|
||||
nvm install 24
|
||||
# Установка Yarn и PM2
|
||||
npm install -g yarn pm2
|
||||
```
|
||||
|
||||
#### 2. Развёртывание проекта
|
||||
|
||||
**Клонировать из GitHub:**
|
||||
|
||||
```bash
|
||||
cd /opt
|
||||
git clone https://github.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
yarn install
|
||||
yarn build
|
||||
```
|
||||
|
||||
**Клонировать из Gitee (для пользователей из Китая):**
|
||||
|
||||
```bash
|
||||
cd /opt
|
||||
git clone https://gitee.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
yarn install
|
||||
yarn build
|
||||
```
|
||||
|
||||
#### 3. Настройка PM2
|
||||
|
||||
Создайте файл `pm2.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "toonflow-app",
|
||||
"script": "data/serve/app.js",
|
||||
"instances": "max",
|
||||
"exec_mode": "cluster",
|
||||
"env": {
|
||||
"NODE_ENV": "prod",
|
||||
"PORT": 10588,
|
||||
"OSSURL": "http://127.0.0.1:10588/"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Описание переменных:**
|
||||
|
||||
| Переменная | Описание |
|
||||
| ------------ | --------------------------------|
|
||||
| `NODE_ENV` | Среда запуска, `prod` — продакшн |
|
||||
| `PORT` | Слушаемый порт |
|
||||
| `OSSURL` | Адрес доступа к статике |
|
||||
|
||||
---
|
||||
|
||||
#### 4. Запуск сервиса
|
||||
|
||||
```bash
|
||||
pm2 start pm2.json
|
||||
pm2 startup
|
||||
pm2 save
|
||||
```
|
||||
|
||||
#### 5. Полезные команды
|
||||
|
||||
```bash
|
||||
pm2 list # Список процессов
|
||||
pm2 logs toonflow-app # Просмотр логов
|
||||
pm2 restart all # Перезапуск сервиса
|
||||
pm2 monit # Мониторинг
|
||||
```
|
||||
|
||||
> ⚠️ **Первый вход**
|
||||
> Логин: `admin`
|
||||
> Пароль: `admin123`
|
||||
|
||||
#### 6. Развёртывание фронта
|
||||
|
||||
Если нужна кастомизация интерфейса или отдельное развертывание фронта — используйте репозиторий фронтенда:
|
||||
|
||||
- **GitHub**: [Toonflow-web](https://github.com/HBAI-Ltd/Toonflow-web)
|
||||
- **Gitee**: [Toonflow-web](https://gitee.com/HBAI-Ltd/Toonflow-web)
|
||||
|
||||
> 💡 **Примечание:** В этот репозиторий уже встроен скомпилированный фронт. Обычным пользователям отдельная установка канала не требуется. Фронт-репозиторий — только для тех, кто хочет разрабатывать/модифицировать UI.
|
||||
|
||||
---
|
||||
|
||||
# 🔧 Руководство по процессу разработки
|
||||
|
||||
> [!CAUTION]
|
||||
> 🚧 **Правила по PR** 🚧
|
||||
>
|
||||
> ⛔ В `master` запрещены любые PR | ✅ Создавайте PR только в ветку `develop`
|
||||
>
|
||||
> Разработчиков приглашаем к со-разработке Toonflow! Для участия пишите главному админу ACT в группу.
|
||||
|
||||
## 🛠️ Технологический стек
|
||||
|
||||
| Категория | Технологии |
|
||||
| ------------ | ------------------------------------------------------------------------------------------------------------------- |
|
||||
| Рантайм | Node.js 23.11.1+ |
|
||||
| Язык | TypeScript 5.x |
|
||||
| Бэкенд | Express 5 |
|
||||
| БД | SQLite (better-sqlite3 / knex) |
|
||||
| AI-интеграции| Vercel AI SDK (OpenAI / Anthropic / Google / DeepSeek / Zhihu / MiniMax / Tongyi Qianwen / xAI) |
|
||||
| Локальный AI | @huggingface/transformers (ONNX) |
|
||||
| RTC | Socket.IO |
|
||||
| Десктоп-клиент| Electron 40 |
|
||||
| Графика | Sharp |
|
||||
| Контейнеризация| Docker |
|
||||
|
||||
## Подготовка среды разработки
|
||||
|
||||
- **Node.js**: не ниже 23.11.1
|
||||
- **Yarn**: рекомендуется менеджер пакетов
|
||||
|
||||
## Быстрый старт проекта
|
||||
|
||||
1. **Клонируйте проект**
|
||||
|
||||
**С GitHub:**
|
||||
|
||||
```bash
|
||||
git clone https://github.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
```
|
||||
|
||||
**С Gitee:**
|
||||
|
||||
```bash
|
||||
git clone https://gitee.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
```
|
||||
|
||||
2. **Установите зависимости**
|
||||
|
||||
В корне проекта выполните:
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
3. **Запуск среды разработки**
|
||||
|
||||
Проект состоит из backend API и frontend. Возможные варианты запуска:
|
||||
|
||||
- **1: Только backend**
|
||||
|
||||
```bash
|
||||
yarn dev
|
||||
```
|
||||
|
||||
> ⚠️ Запускает только backend API (порт 10588); без интерфейса. Для доступа к UI — используйте отдельный frontend проект или запускайте через GUI-модули ниже.
|
||||
|
||||
- **2: Electron-desktop-клиент**
|
||||
|
||||
```bash
|
||||
yarn dev:gui
|
||||
```
|
||||
|
||||
> Открывает backend и Electron GUI-окно — всё встроено, без доп. настроек. Рекомендуется для полноценного использования.
|
||||
|
||||
- **3: Режим продакшн**
|
||||
|
||||
```bash
|
||||
yarn start
|
||||
```
|
||||
|
||||
> Запуск производственной сборки (предварительно `yarn build` обязателен).
|
||||
|
||||
4. **Сборка проекта**
|
||||
|
||||
- Компиляция .ts файлов:
|
||||
|
||||
```bash
|
||||
yarn build
|
||||
```
|
||||
|
||||
- Сборка exe для Windows:
|
||||
|
||||
```bash
|
||||
yarn dist:win
|
||||
```
|
||||
|
||||
- Сборка для Mac:
|
||||
|
||||
```bash
|
||||
yarn dist:mac
|
||||
```
|
||||
|
||||
- Сборка для Linux:
|
||||
|
||||
```bash
|
||||
yarn dist:linux
|
||||
```
|
||||
|
||||
5. **Lint и проверка кода**
|
||||
|
||||
- Проверка кода на ошибки и стиль:
|
||||
|
||||
```bash
|
||||
yarn lint
|
||||
```
|
||||
|
||||
6. **AI Debug-панель (по желанию)**
|
||||
|
||||
Запуск GUI для отладки AI SDK:
|
||||
|
||||
```bash
|
||||
yarn debug:ai
|
||||
```
|
||||
|
||||
## Фронтенд разработка
|
||||
|
||||
Для редактирования интерфейса используйте фронт-репозиторий:
|
||||
|
||||
- **GitHub**: [Toonflow-web](https://github.com/HBAI-Ltd/Toonflow-web)
|
||||
- **Gitee**: [Toonflow-web](https://gitee.com/HBAI-Ltd/Toonflow-web)
|
||||
|
||||
После сборки фронта (`dist/`) скопируйте его содержимое в `data/web/` основного проекта.
|
||||
|
||||
## Структура проекта
|
||||
|
||||
```
|
||||
📂 build/ # Скомпилированные файлы
|
||||
📂 data/ # Данные во время работы
|
||||
│ ├─ 📂 models/ # Локальные AI-модели (ONNX)
|
||||
│ ├─ 📂 oss/ # Объектное хранилище (ассеты/персонажи/сцены)
|
||||
│ ├─ 📂 serve/ # Вход в проде
|
||||
│ ├─ 📂 skills/ # Prompt-словари умений Agent
|
||||
│ └─ 📂 web/ # Скомпилированный фронтенд (встроен)
|
||||
📂 docs/ # Документация
|
||||
📂 env/ # Переменные окружения
|
||||
📂 scripts/ # Скрипты и утилиты
|
||||
📂 src/
|
||||
├─ 📂 agents/ # AI agent-модули
|
||||
│ ├─ 📂 productionAgent/ # Агент генерации
|
||||
│ └─ 📂 scriptAgent/ # Агент сценария
|
||||
├─ 📂 lib/ # Общие библиотеки
|
||||
├─ 📂 middleware/ # Мидлвари
|
||||
├─ 📂 routes/ # Роутинг модули
|
||||
│ ├─ 📂 agents/ # Память агента
|
||||
│ ├─ 📂 artStyle/ # Управление стилями
|
||||
│ ├─ 📂 assets/ # Ассеты
|
||||
│ ├─ 📂 assetsGenerate/ # Генерация ассетов
|
||||
│ ├─ 📂 cornerScape/ # Раскадровка
|
||||
│ ├─ 📂 general/ # Общие эндпоинты
|
||||
│ ├─ 📂 login/ # Авторизация
|
||||
│ ├─ 📂 migrate/ # Миграции
|
||||
│ ├─ 📂 modelSelect/ # Выбор модели
|
||||
│ ├─ 📂 novel/ # Управление романами
|
||||
│ ├─ 📂 other/ # Другое
|
||||
│ ├─ 📂 production/ # Управление производством
|
||||
│ ├─ 📂 project/ # Управление проектом
|
||||
│ ├─ 📂 script/ # Генерация сценария
|
||||
│ ├─ 📂 scriptAgent/ # Эндпоинты агента сценария
|
||||
│ ├─ 📂 setting/ # Настройки системы
|
||||
│ ├─ 📂 task/ # Задачи
|
||||
│ └─ 📂 test/ # Тестовые эндпоинты
|
||||
├─ 📂 socket/ # RealTime WebSocket
|
||||
├─ 📂 types/ # TypeScript типы
|
||||
├─ 📂 utils/ # Утилиты
|
||||
├─ 📄 app.ts # Точка входа
|
||||
├─ 📄 core.ts # Инициализация ядра
|
||||
├─ 📄 env.ts # Работа с окружением
|
||||
├─ 📄 err.ts # Обработка ошибок
|
||||
├─ 📄 logger.ts # Модуль логгирования
|
||||
├─ 📄 router.ts # Регистрация роутов
|
||||
└─ 📄 utils.ts # Вспомогательные функции
|
||||
📄 Dockerfile # Dockerfile
|
||||
📄 electron-builder.yml # Конфиг Electron Builder
|
||||
📄 skillList.json # Список навыков
|
||||
📄 LICENSE # Лицензия (Apache-2.0)
|
||||
📄 NOTICES.txt # Информация о сторонних зависимостях
|
||||
📄 package.json # Конфиг пакетов
|
||||
📄 tsconfig.json # Конфиг TypeScript
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
# 🔗 Связанные репозитории
|
||||
|
||||
| Репозиторий | Описание | GitHub | Gitee |
|
||||
| ---------------- | ------------------------------------- | -------------------------------------------------- | ------------------------------------------------ |
|
||||
| **Toonflow-app** | Полный клиент (этот, для обычных пользователей) | [GitHub](https://github.com/HBAI-Ltd/Toonflow-app) | [Gitee](https://gitee.com/HBAI-Ltd/Toonflow-app) |
|
||||
| **Toonflow-web** | Исходный код фронта (для фронтэндеров) | [GitHub](https://github.com/HBAI-Ltd/Toonflow-web) | [Gitee](https://gitee.com/HBAI-Ltd/Toonflow-web) |
|
||||
|
||||
> 💡 **Подсказка:** если вы просто хотите пользоваться Toonflow — скачайте этот клиент. Отдельный frontend нужен только разработчикам UI.
|
||||
|
||||
---
|
||||
|
||||
# 👨👩👧👦 WeChat-группы
|
||||
|
||||
~~Группа 1~~
|
||||
|
||||
~~Группа 2~~
|
||||
|
||||
...
|
||||
|
||||
~~Группа 10~~
|
||||
|
||||
~~Группа 11~~
|
||||
|
||||
~~Группа 12~~
|
||||
|
||||
~~Группа 13~~
|
||||
|
||||
...
|
||||
|
||||
~~Группа 24~~
|
||||
|
||||
Ассистент по добавлению в группу:
|
||||
|
||||
<img src="./QR.png" alt="Toonflow QR" height="400"/>
|
||||
|
||||
---
|
||||
|
||||
# 💌 Обратная связь
|
||||
|
||||
📧 Email: [ltlctools@outlook.com](mailto:ltlctools@outlook.com?subject=Toonflow咨询)
|
||||
|
||||
---
|
||||
|
||||
# 📜 Лицензия
|
||||
|
||||
Toonflow распространяется по лицензии Apache-2.0 с дополнительным коммерческим соглашением.
|
||||
|
||||
Подробности: https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
## Дополнительное соглашение
|
||||
|
||||
- Если вы распространяете данное ПО как продукт **2 и более независимым третьим сторонам**, необходимо получить **письменную коммерческую лицензию** от HBAI-Ltd.
|
||||
- **≤ 5 юридических лиц**, совместно использующих ПО для внутренних нужд без предоставления услуг третьим сторонам — это **внутреннее использование, лицензия не требуется**.
|
||||
- Запрещено удалять или изменять товарные знаки, логотипы или уведомления об авторских правах Toonflow.
|
||||
|
||||
## Всегда бесплатно — без лицензии
|
||||
|
||||
- ✅ Создание контента в Toonflow и получение дохода на платформах
|
||||
- ✅ Доработка для внутреннего использования команды
|
||||
- ✅ ≤ 5 юрлиц — совместная внутренняя эксплуатация
|
||||
- ✅ Личное обучение, исследования, некоммерческое использование
|
||||
|
||||
## Цены на коммерческую лицензию
|
||||
|
||||
| Этап | Годовой оборот | Годовая плата |
|
||||
|------|---------|------|
|
||||
| 🌱 Старт | < ¥100 тыс. | **Бесплатно** |
|
||||
| 🚀 Стартап | ¥100–500 тыс. | ¥5 000/год |
|
||||
| 📈 Рост | ¥500 тыс.–1,5 млн | ¥20 000/год |
|
||||
| 🏢 Масштаб | ¥1,5–5 млн | ¥80 000/год |
|
||||
| 🌐 Корпоративный | > ¥5 млн | По договорённости |
|
||||
|
||||
> **Условие отсутствия обратной силы**: Пользователи, использовавшие Toonflow по AGPL-3.0 до релиза v1.0.8, продолжают работу по AGPL-3.0 и не затрагиваются данным изменением.
|
||||
|
||||
Полный текст соглашения см. в файле [LICENSE](../LICENSE).
|
||||
|
||||
---
|
||||
|
||||
# ⭐️ История звёзд
|
||||
|
||||
[](https://www.star-history.com/#HBAI-Ltd/Toonflow-app&type=timeline&legend=top-left)
|
||||
|
||||
---
|
||||
|
||||
# 🙏 Благодарности
|
||||
|
||||
Спасибо нижеперечисленным open-source проектам за мощную поддержку Toonflow:
|
||||
|
||||
- [Express](https://expressjs.com/) — быстрый, открытый и лёгкий фреймворк для Node.js
|
||||
- [AI SDK](https://ai-sdk.dev/) — инструменты AI для TypeScript
|
||||
- [Better-SQLite3](https://github.com/WiseLibs/better-sqlite3) — высокопроизводительная обвязка SQLite3
|
||||
- [Sharp](https://sharp.pixelplumbing.com/) — быстрая библиотека для работы с изображениями на Node.js
|
||||
- [Axios](https://axios-http.com/) — HTTP-клиент на промисах
|
||||
- [Zod](https://zod.dev/) — TS-first валидация схем
|
||||
- [Socket.IO](https://socket.io/) — обмен событиями в реальном времени
|
||||
- [Electron](https://www.electronjs.org/) — кроссплатформенный desktop-фреймворк
|
||||
- [Hugging Face Transformers](https://huggingface.co/docs/transformers.js) — фреймворк для локального ML
|
||||
|
||||
Спасибо за поддержку проекту Toonflow от следующих организаций:
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="./sponsored/sophnet.png" alt="算能云 Logo" width="48">
|
||||
</td>
|
||||
<td>
|
||||
<b>Sophnet Cloud</b> — спонсор вычислительных ресурсов
|
||||
<a href="https://www.sophnet.com/">[сайт]</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Полный список сторонних зависимостей — в файле `NOTICES.txt`
|
||||
|
||||
589
docs/README.th.md
Normal file
@ -0,0 +1,589 @@
|
||||
<p>
|
||||
<a href="https://github.com/HBAI-Ltd/Toonflow-app">
|
||||
<img src="https://img.shields.io/badge/GitHub-181717?style=flat-square&logo=github&logoColor=white" alt="GitHub" />
|
||||
</a>
|
||||
|
|
||||
<a href="https://gitee.com/HBAI-Ltd/Toonflow-app">
|
||||
<img src="https://img.shields.io/badge/Gitee-C71D23?style=flat-square&logo=gitee&logoColor=white" alt="Gitee" />
|
||||
</a>
|
||||
|
|
||||
<a href="https://gitcode.com/HBAI-Ltd/Toonflow-app">
|
||||
<img src="./atomgitLogo.png" alt="Atomgit" style="height:16px"/>
|
||||
Atomgit
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="/README.md">简体中文</a> |
|
||||
<a href="./README.zhtw.md">繁體中文</a> |
|
||||
<a href="./README.en.md">English</a> |
|
||||
<strong>ไทย</strong> |
|
||||
<a href="./README.vi.md">Tiếng Việt</a> |
|
||||
<a href="./README.ja.md">日本語</a> |
|
||||
<a href="./README.ru.md">Русский</a>
|
||||
</p>
|
||||
|
||||
<div align="center">
|
||||
|
||||
<img src="./logo.png" alt="Toonflow Logo" height="120"/>
|
||||
|
||||
# Toonflow
|
||||
|
||||
<p align="center">
|
||||
<b>
|
||||
โรงงานละครสั้น AI
|
||||
<br />
|
||||
แตะเพียงครั้งเดียว นิยายกลายเป็นตอนทันที!
|
||||
<br />
|
||||
สคริปต์ AI × ภาพ AI × สร้างเร็วสายฟ้าแลบ 🔥
|
||||
</b>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://github.com/HBAI-Ltd/Toonflow-app/stargazers">
|
||||
<img src="https://img.shields.io/github/stars/HBAI-Ltd/Toonflow-app?style=for-the-badge&logo=github" alt="Stars Badge" />
|
||||
</a>
|
||||
<a href="https://www.apache.org/licenses/LICENSE-2.0" target="_blank">
|
||||
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=for-the-badge" alt="Apache-2.0 License Badge" />
|
||||
</a>
|
||||
<a href="https://github.com/HBAI-Ltd/Toonflow-app/releases">
|
||||
<img alt="release" src="https://img.shields.io/github/v/release/HBAI-Ltd/Toonflow-app?style=for-the-badge" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
> 🚀 **ผลิตละครสั้นครบวงจร:** จากข้อความสู่นักแสดง จากสตอรี่บอร์ดสู่วิดีโอ AI แบบเต็มกระบวนการ ทุกขั้นตอน ไม่มีอุปสรรค ประสิทธิภาพสร้าง 10 เท่าขึ้นไป!
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
# 🌟 ฟีเจอร์หลัก
|
||||
|
||||
Toonflow คือเครื่องมือคอมิกละครสั้น AI ที่ใช้เทคโนโลยี AI แปลงนิยายเป็นสคริปต์โดยอัตโนมัติ และใช้ภาพและวิดีโอ AI เพื่อสร้างละครสั้นได้อย่างมีประสิทธิภาพ ด้วย Toonflow คุณสามารถสร้างผลงานจากข้อความสู่ภาพนิ่งจนถึงวิดีโอ ได้อย่างชาญฉลาดและสะดวก
|
||||
|
||||
- ✅ **สร้างตัวละครอัตโนมัติ**
|
||||
วิเคราะห์เนื้อหานิยายต้นฉบับ ระบุและสร้างข้อมูลตัวละครอย่างชาญฉลาด ทั้งรูปร่าง นิสัย ตัวตน เป็นต้น สร้างพื้นฐานที่แข็งแรงสำหรับสคริปต์และภาพในขั้นถัดไป
|
||||
- ✅ **สร้างสคริปต์อัตโนมัติ**
|
||||
จากเหตุการณ์และบทที่เลือก ระบบจะสร้างสคริปต์เชิงโครงสร้างอัตโนมัติ ครอบคลุมบทสนทนา คำบรรยายฉาก และทิศทางเนื้อเรื่อง เปลี่ยนข้อความวรรณกรรมเป็นสคริปต์ละครได้อย่างรวดเร็ว
|
||||
- ✅ **ผลิตสตอรี่บอร์ดอัตโนมัติ**
|
||||
ตามสคริปต์ สร้างพรอมต์สตอรี่บอร์ดและงานออกแบบภาพอัตโนมัติ รายละเอียดองค์ประกอบหน้า/กลาง/หลัง การเคลื่อนไหวตัวละคร อุปกรณ์ประกอบฉาก และการจัดวางฉาก พลิกสคริปต์เป็นสตอรี่บอร์ดวางแผนผลิตวิดีโอได้ครบถ้วน
|
||||
- ✅ **ประกอบวิดีโอด้วย AI**
|
||||
ผนวกเทคโนโลยีภาพและวิดีโอ AI สร้างคลิปวิดีโอด้วย AI รวมฟีเจอร์แก้ไขออนไลน์ รองรับการตั้งค่าผลลัพธ์ที่ปรับแต่งได้ ทำให้การสร้างภาพยนตร์/ละครมีประสิทธิภาพและทำงานร่วมทีมได้
|
||||
|
||||
---
|
||||
|
||||
# 📦 ตัวอย่างการใช้งาน
|
||||
|
||||
- สร้างวิดีโอละครสั้น
|
||||
- ทดลองแปลงนิยายสู่ภาพยนตร์/ละคร
|
||||
- เครื่องมือดัดแปลงวรรณกรรมด้วย AI
|
||||
- การพัฒนาสคริปต์และต้นแบบผลิตงานเร็ว
|
||||
- สร้างวัตถุดิบประกอบวิดีโอ
|
||||
|
||||
---
|
||||
|
||||
# 🔰 คู่มือผู้ใช้
|
||||
|
||||
## 📺 วิดีโอสอนใช้งาน
|
||||
|
||||
https://www.bilibili.com/video/BV1na6wB6Ea2
|
||||
[](https://www.bilibili.com/video/BV1na6wB6Ea2)
|
||||
|
||||
**วิดีโอแนะนำ Toonflow ฉบับเร่งด่วน 8 นาที**
|
||||
👉 [คลิกเพื่อรับชม](https://www.bilibili.com/video/BV1na6wB6Ea2/?share_source=copy_web&vd_source=5b718c25439a901a34c7bc0c1d35b38e)
|
||||
|
||||
📱 สแกนด้วย WeChat บนมือถือเพื่อชม
|
||||
|
||||
<img src="./videoQR.png" alt="Scan WeChat to Watch" width="150"/>
|
||||
|
||||
---
|
||||
|
||||
# 🚀 การติดตั้ง
|
||||
|
||||
## สิ่งที่ต้องเตรียมก่อน
|
||||
|
||||
ก่อนติดตั้งและใช้งานซอฟต์แวร์นี้ กรุณาเตรียมสิ่งเหล่านี้:
|
||||
|
||||
- ✅ ที่อยู่ API บริการ AI แบบ Large Language Model
|
||||
- ✅ ที่อยู่ API บริการวิดีโอ Sora หรือ Doubao
|
||||
- ✅ ที่อยู่ API โมเดลสร้างภาพ Nano Banana Pro
|
||||
|
||||
## ติดตั้งในเครื่อง (Local Installation)
|
||||
|
||||
### 1. ดาวน์โหลดและติดตั้ง
|
||||
|
||||
| ระบบปฏิบัติการ | ดาวน์โหลดจาก GitHub | ดาวน์โหลดผ่าน Quark Cloud | หมายเหตุ |
|
||||
| :--------------: | :------------------------------------------------------------ | :----------------------------------------------- | :------------- |
|
||||
| Windows | [Release](https://github.com/HBAI-Ltd/Toonflow-app/releases) | [Quark Cloud](https://pan.quark.cn/s/94ef07509df0) | ตัวติดตั้งอย่างเป็นทางการ |
|
||||
| Linux | [Release](https://github.com/HBAI-Ltd/Toonflow-app/releases) | [Quark Cloud](https://pan.quark.cn/s/94ef07509df0) | ตัวติดตั้งอย่างเป็นทางการ |
|
||||
| macOS | [Release](https://github.com/HBAI-Ltd/Toonflow-app/releases) | [Quark Cloud](https://pan.quark.cn/s/94ef07509df0) | ตัวติดตั้งอย่างเป็นทางการ |
|
||||
|
||||
> [!CAUTION]
|
||||
> บน MacOS ให้ไปที่ ตั้งค่า - ความเป็นส่วนตัวและความปลอดภัย ตั้งค่าความปลอดภัยก่อน มิฉะนั้นอาจไม่สามารถเปิดแอปได้เพราะปัญหาใบรับรอง
|
||||
>
|
||||
> ดูเอกสารฉบับภาษาจีน: [https://www.zhihu.com/question/433389276](https://www.zhihu.com/question/433389276)
|
||||
|
||||
> ด้วยข้อจำกัดของสภาพแวดล้อม Gitee OS และขนาดไฟล์ Release การดาวน์โหลดผ่าน Gitee Release ยังไม่เปิดให้บริการในขณะนี้
|
||||
|
||||
### 2. เปิดใช้งานโปรแกรม
|
||||
|
||||
ติดตั้งเสร็จแล้วให้เปิดโปรแกรมเพื่อเริ่มใช้งาน
|
||||
|
||||
> ⚠️ **ล็อกอินครั้งแรก**
|
||||
> ชื่อผู้ใช้: `admin`
|
||||
> รหัสผ่าน: `admin123`
|
||||
|
||||
## การใช้ Docker
|
||||
|
||||
### สิ่งที่ต้องเตรียม
|
||||
|
||||
- ติดตั้ง [Docker](https://docs.docker.com/get-docker/) (เวอร์ชัน 20.10+)
|
||||
|
||||
### วิธีที่ 1: ติดตั้งออนไลน์
|
||||
|
||||
กำลังพัฒนา; ขณะนี้ให้ใช้การ build ในเครื่อง
|
||||
|
||||
### วิธีที่ 2: สร้างเองในเครื่อง
|
||||
|
||||
สำหรับนักพัฒนา หรือผู้ที่ clone repo แล้ว ต้องติดตั้ง Git ที่เครื่อง
|
||||
|
||||
```shell
|
||||
# clone โปรเจกต์ (ถ้าทำแล้วข้าม)
|
||||
git clone https://github.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
|
||||
# สร้างและเริ่มผ่าน docker-compose
|
||||
yarn docker:local
|
||||
|
||||
# หรือสร้างแบบ manual
|
||||
docker build -t toonflow .
|
||||
docker run -d -p <local_port>:10588 -v <local_data_path>:/app/data toonflow
|
||||
|
||||
# ใช้งานที่ /web/index.html ในพอร์ตที่แม็ปไว้ เช่น
|
||||
# http://localhost:10588/web/index.html
|
||||
```
|
||||
|
||||
### รายละเอียดพอร์ตบริการ
|
||||
|
||||
| พอร์ต | วัตถุประสงค์ | Mapping ในการติดตั้ง |
|
||||
| -------- | ------------ | -------------------- |
|
||||
| `10588` | ส่วนติดต่อแอป | `10588:10588` |
|
||||
|
||||
**รายละเอียดตัวแปรแวดล้อม:**
|
||||
|
||||
| ตัวแปร | รายละเอียด |
|
||||
| ------------- | ----------------------------------------- |
|
||||
| `NODE_ENV` | สภาพแวดล้อม เลือก `prod` คือ production |
|
||||
| `PORT` | พอร์ตการฟังบริการ (ค่าเริ่มต้น 10588) |
|
||||
| `OSSURL` | ที่อยู่สำหรับเข้าถึงไฟล์ static |
|
||||
|
||||
---
|
||||
|
||||
## ติดตั้งบน Cloud
|
||||
|
||||
### 1. ข้อกำหนดเครื่องเซิร์ฟเวอร์
|
||||
|
||||
- **ระบบปฏิบัติการ:** Ubuntu 20.04+ / CentOS 7+
|
||||
- **Node.js:** 24.x (แนะนำ ขั้นต่ำ 23.11.1+)
|
||||
- **RAM:** 2GB ขึ้นไป
|
||||
|
||||
### 2. วิธีติดตั้ง
|
||||
|
||||
#### 1. ติดตั้งสภาพแวดล้อม
|
||||
|
||||
```bash
|
||||
# ติดตั้ง Node.js
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
||||
source ~/.bashrc
|
||||
nvm install 24
|
||||
# ติดตั้ง Yarn และ PM2
|
||||
npm install -g yarn pm2
|
||||
```
|
||||
|
||||
#### 2. ติดตั้งโปรเจกต์
|
||||
|
||||
**Clone จาก GitHub:**
|
||||
|
||||
```bash
|
||||
cd /opt
|
||||
git clone https://github.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
yarn install
|
||||
yarn build
|
||||
```
|
||||
|
||||
**Clone จาก Gitee (แนะนำในจีนแผ่นดินใหญ่):**
|
||||
|
||||
```bash
|
||||
cd /opt
|
||||
git clone https://gitee.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
yarn install
|
||||
yarn build
|
||||
```
|
||||
|
||||
#### 3. ตั้งค่า PM2
|
||||
|
||||
สร้างไฟล์ `pm2.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "toonflow-app",
|
||||
"script": "data/serve/app.js",
|
||||
"instances": "max",
|
||||
"exec_mode": "cluster",
|
||||
"env": {
|
||||
"NODE_ENV": "prod",
|
||||
"PORT": 10588,
|
||||
"OSSURL": "http://127.0.0.1:10588/"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**รายละเอียดตัวแปรแวดล้อม:**
|
||||
|
||||
| ตัวแปร | รายละเอียด |
|
||||
| ------------- | ---------------------------------------- |
|
||||
| `NODE_ENV` | สภาพแวดล้อม เลือก `prod` คือ production |
|
||||
| `PORT` | พอร์ตให้บริการ |
|
||||
| `OSSURL` | ที่อยู่สำหรับเข้าถึงไฟล์ static |
|
||||
|
||||
---
|
||||
|
||||
#### 4. เริ่มบริการ
|
||||
|
||||
```bash
|
||||
pm2 start pm2.json
|
||||
pm2 startup
|
||||
pm2 save
|
||||
```
|
||||
|
||||
#### 5. คำสั่งที่ใช้บ่อย
|
||||
|
||||
```bash
|
||||
pm2 list # ดูรายชื่อโปรเซส
|
||||
pm2 logs toonflow-app # ดู Log
|
||||
pm2 restart all # รีสตาร์ทบริการ
|
||||
pm2 monit # ดูระบบแบบเรียลไทม์
|
||||
```
|
||||
|
||||
> ⚠️ **ล็อกอินครั้งแรก**
|
||||
> ชื่อผู้ใช้: `admin`
|
||||
> รหัสผ่าน: `admin123`
|
||||
|
||||
#### 6. ติดตั้งส่วนหน้าเว็บไซต์
|
||||
|
||||
ถ้าต้องการใช้ Frontend แยก หรือปรับแต่ UI ศึกษาที่ repo ส่วน frontend:
|
||||
|
||||
- **GitHub**: [Toonflow-web](https://github.com/HBAI-Ltd/Toonflow-web)
|
||||
- **Gitee**: [Toonflow-web](https://gitee.com/HBAI-Ltd/Toonflow-web)
|
||||
|
||||
> 💡 **หมายเหตุ:** รีโปนี้ใส่ frontend ที่ compile แล้วมาด้วย ผู้ใช้ทั่วไปไม่จำเป็นต้องติดตั้ง frontend แยก Repo frontend ใช้สำหรับนักพัฒนาที่ต้องการพัฒนาต่อ
|
||||
|
||||
---
|
||||
|
||||
# 🔧 คู่มือนักพัฒนา
|
||||
|
||||
> [!CAUTION]
|
||||
> 🚧 **แนวทางการส่ง PR** 🚧
|
||||
>
|
||||
> ⛔ `master` ไม่รับ PR | ✅ ส่ง PR ที่ `develop`
|
||||
>
|
||||
> เชิญนักพัฒนาร่วมพัฒนา Toonflow ติดต่อเจ้าของ ACT ในแชทกลุ่ม
|
||||
|
||||
## 🛠️ Tech Stack
|
||||
|
||||
| หมวด | เทคโนโลยี |
|
||||
| ------------ | ------------------------------------------------------------------------------------ |
|
||||
| Runtime | Node.js 23.11.1+ |
|
||||
| Language | TypeScript 5.x |
|
||||
| Backend | Express 5 |
|
||||
| Database | SQLite (better-sqlite3 / knex) |
|
||||
| AI Integration | Vercel AI SDK (OpenAI / Anthropic / Google / DeepSeek / Zhipu / MiniMax / Qwen / xAI) |
|
||||
| Local Inference | @huggingface/transformers (ONNX) |
|
||||
| Real-Time | Socket.IO |
|
||||
| Desktop | Electron 40 |
|
||||
| Image Proc. | Sharp |
|
||||
| Container | Docker |
|
||||
|
||||
## เตรียมสภาพแวดล้อม
|
||||
|
||||
- **Node.js:** ต้องใช้ 23.11.1 ขึ้นไปเท่านั้น
|
||||
- **Yarn:** แนะนำให้ใช้เป็น package manager
|
||||
|
||||
## เริ่มพัฒนาอย่างรวดเร็ว
|
||||
|
||||
1. **Clone โปรเจกต์**
|
||||
|
||||
**GitHub:**
|
||||
|
||||
```bash
|
||||
git clone https://github.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
```
|
||||
|
||||
**Gitee (ในจีนแผ่นดินใหญ่แนะนำ):**
|
||||
|
||||
```bash
|
||||
git clone https://gitee.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
```
|
||||
|
||||
2. **ติดตั้ง dependencies**
|
||||
|
||||
รันที่ root directory:
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
3. **เริ่มสภาพแวดล้อมพัฒนา**
|
||||
|
||||
โปรเจกต์นี้มี **backend API service** และ **frontend interface** เลือกวิธีเริ่มต้นได้:
|
||||
|
||||
- **ตัวเลือก 1: เริ่ม backend อย่างเดียว**
|
||||
|
||||
```bash
|
||||
yarn dev
|
||||
```
|
||||
|
||||
> ⚠️ คำสั่งนี้เปิดเฉพาะ backend API (พอร์ต 10588) **ไม่มี web UI** การเข้า http://localhost:10588 คือเรียก API เท่านั้น การใช้ web UI เต็มรูปแบบใช้วิธีด้านล่าง
|
||||
|
||||
- **ตัวเลือก 2: เริ่ม Electron desktop client**
|
||||
|
||||
```bash
|
||||
yarn dev:gui
|
||||
```
|
||||
|
||||
> คำสั่งนี้เปิดทั้ง backend และ Electron window มี web UI built-in พร้อมใช้งาน
|
||||
|
||||
- **ตัวเลือก 3: โหมด production**
|
||||
|
||||
```bash
|
||||
yarn start
|
||||
```
|
||||
|
||||
> รันทั้ง backend แบบโปรดักชั่น (ต้อง `yarn build` ก่อน)
|
||||
|
||||
4. **คอมไพล์โปรเจกต์**
|
||||
|
||||
- คอมไพล์ TypeScript:
|
||||
|
||||
```bash
|
||||
yarn build
|
||||
```
|
||||
|
||||
- สร้าง executable สำหรับ Windows:
|
||||
|
||||
```bash
|
||||
yarn dist:win
|
||||
```
|
||||
|
||||
- สร้าง executable สำหรับ Mac:
|
||||
|
||||
```bash
|
||||
yarn dist:mac
|
||||
```
|
||||
|
||||
- สร้าง executable สำหรับ Linux:
|
||||
|
||||
```bash
|
||||
yarn dist:linux
|
||||
```
|
||||
|
||||
5. **ตรวจสอบคุณภาพโค้ด**
|
||||
|
||||
- เช็ค lint:
|
||||
|
||||
```bash
|
||||
yarn lint
|
||||
```
|
||||
|
||||
6. **AI Debug panel (ไม่บังคับ)**
|
||||
|
||||
รัน Visual Debugging Tool ของ Vercel AI SDK เพื่อ debug integration AI ได้ง่ายขึ้น:
|
||||
|
||||
```bash
|
||||
yarn debug:ai
|
||||
```
|
||||
|
||||
## การพัฒนา Frontend
|
||||
|
||||
หากต้องการพัฒนา UI แก้ไขที่ frontend repo:
|
||||
|
||||
- **GitHub**: [Toonflow-web](https://github.com/HBAI-Ltd/Toonflow-web)
|
||||
- **Gitee**: [Toonflow-web](https://gitee.com/HBAI-Ltd/Toonflow-web)
|
||||
|
||||
หลัง build frontend แล้ว ให้นำไฟล์ใน `dist` ไปวางใน `data/web` ของโปรเจกต์นี้
|
||||
|
||||
## โครงสร้างโปรเจกต์
|
||||
|
||||
```
|
||||
📂 build/ # ผลลัพธ์หลังคอมไพล์
|
||||
📂 data/ # ข้อมูล runtime
|
||||
│ ├─ 📂 models/ # โมเดล inference ในเครื่อง (ONNX)
|
||||
│ ├─ 📂 oss/ # ที่เก็บวัตถุ (assets/character/scene)
|
||||
│ ├─ 📂 serve/ # จุดเริ่ม production
|
||||
│ ├─ 📂 skills/ # เอเจนท์พรอมต์ทักษะต่างๆ
|
||||
│ └─ 📂 web/ # asset frontend ที่มาในตัว
|
||||
📂 ./ # เอกสาร
|
||||
📂 env/ # ไฟล์ config environment
|
||||
📂 scripts/ # script สร้างและช่วยงาน
|
||||
📂 src/
|
||||
├─ 📂 agents/ # โมดูล AI Agent ต่างๆ
|
||||
│ ├─ 📂 productionAgent/ # เอเจนท์ผลิตงาน
|
||||
│ └─ 📂 scriptAgent/ # เอเจนท์สคริปต์
|
||||
├─ 📂 lib/ # ไลบรารีทั่วไป (db, response)
|
||||
├─ 📂 middleware/ # Middleware ต่างๆ
|
||||
├─ 📂 routes/ # เส้นทาง API หลัก
|
||||
│ ├─ 📂 agents/ # จัดการความจำเอเจนท์
|
||||
│ ├─ 📂 artStyle/ # จัดการสไตล์ศิลปะ
|
||||
│ ├─ 📂 assets/ # จัดการ asset
|
||||
│ ├─ 📂 assetsGenerate/ # สร้าง asset อัตโนมัติ
|
||||
│ ├─ 📂 cornerScape/ # จัดการสตอรี่บอร์ด
|
||||
│ ├─ 📂 general/ # API ทั่วไป
|
||||
│ ├─ 📂 login/ # ยืนยันตัวตนเข้าใช้
|
||||
│ ├─ 📂 migrate/ # ย้ายโครงสร้างข้อมูล
|
||||
│ ├─ 📂 modelSelect/ # จัดการเลือกโมเดล
|
||||
│ ├─ 📂 novel/ # จัดการนิยาย
|
||||
│ ├─ 📂 other/ # ฟีเจอร์อื่นๆ
|
||||
│ ├─ 📂 production/ # จัดการการผลิต
|
||||
│ ├─ 📂 project/ # จัดการโปรเจกต์
|
||||
│ ├─ 📂 script/ # สร้างสคริปต์
|
||||
│ ├─ 📂 scriptAgent/ # Endpoint AI Agent สคริปต์
|
||||
│ ├─ 📂 setting/ # ตั้งค่าระบบ
|
||||
│ ├─ 📂 task/ # จัดการงาน
|
||||
│ └─ 📂 test/ # ทดสอบ API
|
||||
├─ 📂 socket/ # การสื่อสาร WebSocket
|
||||
├─ 📂 types/ # TypeScript type definitions
|
||||
├─ 📂 utils/ # ฟังก์ชันอรรถประโยชน์
|
||||
├─ 📄 app.ts # จุดเข้าแอป
|
||||
├─ 📄 core.ts # core initialization
|
||||
├─ 📄 env.ts # ตัวแปร env
|
||||
├─ 📄 err.ts # จัดการ error
|
||||
├─ 📄 logger.ts # log โมดูล
|
||||
├─ 📄 router.ts # ลงทะเบียน route ต่าง ๆ
|
||||
└─ 📄 utils.ts # เครื่องมือทั่วไป
|
||||
📄 Dockerfile # config สำหรับ docker build
|
||||
📄 electron-builder.yml # config แพ็ค Electron
|
||||
📄 skillList.json # รายการทักษะ
|
||||
📄 LICENSE # ใบอนุญาต Apache-2.0
|
||||
📄 NOTICES.txt # รายงานไลบรารีที่ใช้
|
||||
📄 package.json # config โปรเจกต์
|
||||
📄 tsconfig.json # TypeScript config
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
# 🔗 รีโพที่เกี่ยวข้อง
|
||||
|
||||
| รีโพ | คำอธิบาย | GitHub | Gitee |
|
||||
| ------------ | ----------------- | ----------------------------------------------- | -------------------------------------------- |
|
||||
| **Toonflow-app** | ตัวเต็ม (รีโปนี้, สำหรับผู้ใช้) | [GitHub](https://github.com/HBAI-Ltd/Toonflow-app) | [Gitee](https://gitee.com/HBAI-Ltd/Toonflow-app) |
|
||||
| **Toonflow-web** | ซอร์ส frontend (สำหรับ dev FE) | [GitHub](https://github.com/HBAI-Ltd/Toonflow-web) | [Gitee](https://gitee.com/HBAI-Ltd/Toonflow-web) |
|
||||
|
||||
> 💡 **หมายเหตุ:** ถ้าแค่ต้องการใช้งาน ดาวน์โหลดไคลเอนต์จากรีโปนี้ได้เลย รีโป frontend เหมาะสำหรับ dev ที่จะพัฒนา UI ต่อ
|
||||
|
||||
---
|
||||
|
||||
# 👨👩👧👦 กลุ่ม WeChat
|
||||
|
||||
~~กลุ่ม 1~~
|
||||
|
||||
~~กลุ่ม 2~~
|
||||
|
||||
...
|
||||
|
||||
~~กลุ่ม 10~~
|
||||
|
||||
~~กลุ่ม 11~~
|
||||
|
||||
~~กลุ่ม 12~~
|
||||
|
||||
~~กลุ่ม 13~~
|
||||
|
||||
...
|
||||
|
||||
~~กลุ่ม 24~~
|
||||
|
||||
ผู้ช่วยกลุ่ม:
|
||||
|
||||
<img src="./QR.png" alt="Toonflow QR" height="400"/>
|
||||
|
||||
---
|
||||
|
||||
# 💌 ติดต่อเรา
|
||||
|
||||
📧 อีเมล: [ltlctools@outlook.com](mailto:ltlctools@outlook.com?subject=Toonflow inquiry)
|
||||
|
||||
---
|
||||
|
||||
# 📜 ใบอนุญาต
|
||||
|
||||
Toonflow เป็นโอเพ่นซอร์สภายใต้ Apache-2.0 พร้อมข้อตกลงเชิงพาณิชย์เพิ่มเติม
|
||||
|
||||
รายละเอียด: https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
## ข้อตกลงเพิ่มเติม
|
||||
|
||||
- หากแจกจ่ายซอฟต์แวร์นี้ในฐานะผลิตภัณฑ์ให้ **บุคคลที่สามอิสระ 2 รายขึ้นไป** ต้องได้รับ **อนุญาตเชิงพาณิชย์เป็นลายลักษณ์อักษร** จาก HBAI-Ltd
|
||||
- **≤ 5 นิติบุคคล** ร่วมดำเนินงานภายในโดยไม่ให้บริการภายนอก ถือเป็น **การใช้งานภายใน ไม่ต้องขออนุญาต**
|
||||
- ห้ามลบหรือแก้ไขเครื่องหมายการค้า โลโก้ หรือข้อมูลลิขสิทธิ์ใน Toonflow
|
||||
|
||||
## ใช้งานฟรีตลอดกาล
|
||||
|
||||
- ✅ ใช้ Toonflow สร้างเนื้อหาและรับส่วนแบ่งรายได้จากแพลตฟอร์ม
|
||||
- ✅ พัฒนาต่อยอดสำหรับทีมภายใน
|
||||
- ✅ ≤ 5 นิติบุคคลร่วมดำเนินงานภายใน
|
||||
- ✅ เรียนรู้ส่วนตัว วิจัย และใช้งานที่ไม่ใช่เชิงพาณิชย์
|
||||
|
||||
## ราคาใบอนุญาตเชิงพาณิชย์
|
||||
|
||||
| ระยะ | ยอดขายต่อปี | ค่าธรรมเนียมต่อปี |
|
||||
|------|---------|------|
|
||||
| 🌱 บ่มเพาะ | < ¥100,000 | **ฟรี** |
|
||||
| 🚀 สตาร์ทอัพ | ¥100,000–500,000 | ¥5,000/ปี |
|
||||
| 📈 เติบโต | ¥500,000–1,500,000 | ¥20,000/ปี |
|
||||
| 🏢 ขยายตัว | ¥1,500,000–5,000,000 | ¥80,000/ปี |
|
||||
| 🌐 องค์กร | > ¥5,000,000 | เจรจา |
|
||||
|
||||
> **เงื่อนไขไม่ย้อนหลัง**: ผู้ใช้ที่ใช้ Toonflow ภายใต้ AGPL-3.0 ก่อนการเผยแพร่ v1.0.8 จะไม่ได้รับผลกระทบจากการเปลี่ยนแปลงนี้ การใช้งานปัจจุบันยังคงเป็นไปตาม AGPL-3.0
|
||||
|
||||
ดูข้อตกลงฉบับเต็มที่ [LICENSE](../LICENSE)
|
||||
|
||||
---
|
||||
|
||||
# ⭐️ ประวัติการกดดาว
|
||||
|
||||
[](https://www.star-history.com/#HBAI-Ltd/Toonflow-app&type=timeline&legend=top-left)
|
||||
|
||||
---
|
||||
|
||||
# 🙏 ขอขอบคุณ
|
||||
|
||||
ขอบคุณโอเพ่นซอร์สต่อไปนี้ที่สนับสนุน Toonflow:
|
||||
|
||||
- [Express](https://expressjs.com/) - เฟรมเวิร์ก Node.js ที่เร็ว เล็ก และเปิดกว้าง
|
||||
- [AI SDK](https://ai-sdk.dev/) - ชุดเครื่องมือ AI-first สำหรับ TypeScript
|
||||
- [Better-SQLite3](https://github.com/WiseLibs/better-sqlite3) - Binding SQLite3 ประสิทธิภาพสูง
|
||||
- [Sharp](https://sharp.pixelplumbing.com/) - ไลบรารีจัดการภาพบน Node.js ประสิทธิภาพสูง
|
||||
- [Axios](https://axios-http.com/) - HTTP client แบบ Promise
|
||||
- [Zod](https://zod.dev/) - ไลบรารีตรวจสอบชนิด TypeScript เป็นหลัก
|
||||
- [Socket.IO](https://socket.io/) - เฟรมเวิร์ก event bidirectional แบบเรียลไทม์
|
||||
- [Electron](https://www.electronjs.org/) - เฟรมเวิร์กสร้างแอปเดสก์ท็อปข้ามแพลตฟอร์ม
|
||||
- [Hugging Face Transformers](https://huggingface.co./transformers.js) - ไลบรารี ML inference ในเครื่อง
|
||||
|
||||
ขอบคุณองค์กร/บุคคลต่อไปนี้สนับสนุน Toonflow:
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="./sponsored/sophnet.png" alt="SophNet Logo" width="48">
|
||||
</td>
|
||||
<td>
|
||||
<b>SophNet Cloud</b> เป็นผู้สนับสนุนทรัพยากรการประมวลผล
|
||||
<a href="https://www.sophnet.com/">[เว็บไซต์]</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
รายชื่อไลบรารีภายนอกทั้งหมด ดูได้ที่ `NOTICES.txt`
|
||||
|
||||
589
docs/README.vi.md
Normal file
@ -0,0 +1,589 @@
|
||||
<p>
|
||||
<a href="https://github.com/HBAI-Ltd/Toonflow-app">
|
||||
<img src="https://img.shields.io/badge/GitHub-181717?style=flat-square&logo=github&logoColor=white" alt="GitHub" />
|
||||
</a>
|
||||
|
|
||||
<a href="https://gitee.com/HBAI-Ltd/Toonflow-app">
|
||||
<img src="https://img.shields.io/badge/Gitee-C71D23?style=flat-square&logo=gitee&logoColor=white" alt="Gitee" />
|
||||
</a>
|
||||
|
|
||||
<a href="https://gitcode.com/HBAI-Ltd/Toonflow-app">
|
||||
<img src="./atomgitLogo.png" alt="Atomgit" style="height:16px"/>
|
||||
Atomgit
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="/README.md">简体中文</a> |
|
||||
<a href="./README.zhtw.md">繁體中文</a> |
|
||||
<a href="./README.en.md">English</a> |
|
||||
<a href="./README.th.md">ไทย</a> |
|
||||
<strong>Tiếng Việt</strong> |
|
||||
<a href="./README.ja.md">日本語</a> |
|
||||
<a href="./README.ru.md">Русский</a>
|
||||
</p>
|
||||
|
||||
<div align="center">
|
||||
|
||||
<img src="./logo.png" alt="Toonflow Logo" height="120"/>
|
||||
|
||||
# Toonflow
|
||||
|
||||
<p align="center">
|
||||
<b>
|
||||
Xưởng sản xuất phim ngắn AI
|
||||
<br />
|
||||
Động ngón tay là tiểu thuyết hóa thành phim ngay!
|
||||
<br />
|
||||
Kịch bản AI × Hình ảnh AI × Tạo dựng thần tốc 🔥
|
||||
</b>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://github.com/HBAI-Ltd/Toonflow-app/stargazers">
|
||||
<img src="https://img.shields.io/github/stars/HBAI-Ltd/Toonflow-app?style=for-the-badge&logo=github" alt="Stars Badge" />
|
||||
</a>
|
||||
<a href="https://www.apache.org/licenses/LICENSE-2.0" target="_blank">
|
||||
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=for-the-badge" alt="Apache-2.0 License Badge" />
|
||||
</a>
|
||||
<a href="https://github.com/HBAI-Ltd/Toonflow-app/releases">
|
||||
<img alt="release" src="https://img.shields.io/github/v/release/HBAI-Ltd/Toonflow-app?style=for-the-badge" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
> 🚀 **Công cụ sản xuất phim ngắn một cửa**: Từ văn bản tới nhân vật, từ dàn cảnh tới video, toàn bộ quy trình AI hóa không cần kỹ năng, tăng hiệu quả sáng tạo gấp 10 lần+!
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
# 🌟 Tính năng chính
|
||||
|
||||
Toonflow là công cụ AI tạo phim truyện tranh ngắn, tận dụng công nghệ AI để chuyển tự động tiểu thuyết thành kịch bản, kết hợp hình ảnh, video AI để sáng tác phim ngắn hiệu quả. Với Toonflow, bạn dễ dàng hoàn thành toàn bộ quy trình từ văn bản tới hình ảnh, khiến chế tác phim ngắn trở nên thông minh và tiện lợi hơn bao giờ hết.
|
||||
|
||||
- ✅ **Tạo nhân vật**
|
||||
Phân tích tự động văn bản tiểu thuyết gốc, nhận diện thông minh và xây dựng thiết lập nhân vật, gồm ngoại hình, tính cách, thân phận,... cung cấp nền tảng chắc chắn cho sáng tác kịch bản và hình ảnh sau này.
|
||||
- ✅ **Tạo kịch bản**
|
||||
Dựa trên sự kiện và chương đã chọn, hệ thống tự động tạo kịch bản có cấu trúc gồm thoại, mô tả cảnh, diễn biến tình tiết, chuyển đổi hiệu quả từ văn học sang kịch bản truyền hình, điện ảnh.
|
||||
- ✅ **Làm phân cảnh**
|
||||
Theo nội dung kịch bản, tự động tạo từ khóa phân cảnh, thiết kế hình ảnh, chi tiết tiền trung hậu cảnh, động thái nhân vật, thiết lập đạo cụ và bố trí trường quay, tự động phân cảnh dựa trên kịch bản, tối ưu đường lối sản xuất video.
|
||||
- ✅ **Tổng hợp video**
|
||||
Tích hợp công nghệ tạo ảnh và video AI, dùng AI tạo phân đoạn video, biên tập trực tuyến, hỗ trợ điều chỉnh cá nhân hóa đầu ra, giúp sáng tác phim hiệu quả, triển khai nhanh.
|
||||
|
||||
---
|
||||
|
||||
# 📦 Ứng dụng
|
||||
|
||||
- Sáng tác nội dung video ngắn
|
||||
- Thử nghiệm điện ảnh hóa tiểu thuyết
|
||||
- Công cụ AI chuyển thể văn học
|
||||
- Phát triển, dựng mẫu nhanh kịch bản
|
||||
- Tạo nguyên liệu video
|
||||
|
||||
---
|
||||
|
||||
# 🔰 Hướng dẫn sử dụng
|
||||
|
||||
## 📺 Video hướng dẫn
|
||||
|
||||
https://www.bilibili.com/video/BV1na6wB6Ea2
|
||||
[](https://www.bilibili.com/video/BV1na6wB6Ea2)
|
||||
|
||||
**Toonflow 8 phút nhanh chóng bắt đầu với AI Video**
|
||||
👉 [Click xem tại đây](https://www.bilibili.com/video/BV1na6wB6Ea2/?share_source=copy_web&vd_source=5b718c25439a901a34c7bc0c1d35b38e)
|
||||
|
||||
📱 Quét mã QR trên WeChat để xem trên điện thoại
|
||||
|
||||
<img src="./videoQR.png" alt="微信扫码观看" width="150"/>
|
||||
|
||||
---
|
||||
|
||||
# 🚀 Cài đặt
|
||||
|
||||
## Điều kiện tiên quyết
|
||||
|
||||
Trước khi cài đặt và sử dụng, hãy chuẩn bị:
|
||||
|
||||
- ✅ Địa chỉ API dịch vụ mô hình ngôn ngữ lớn (AI)
|
||||
- ✅ Địa chỉ API dịch vụ video Sora hoặc Đậu Bao
|
||||
- ✅ Địa chỉ API dịch vụ tạo ảnh Nano Banana Pro
|
||||
|
||||
## Cài đặt tại máy
|
||||
|
||||
### 1. Tải về & cài đặt
|
||||
|
||||
| Hệ điều hành | Tải GitHub | Tải qua Quark Drive | Ghi chú |
|
||||
| :---------: | :-------------------------------------------------------- | :--------------------------------------------- | :-------------- |
|
||||
| Windows | [Release](https://github.com/HBAI-Ltd/Toonflow-app/releases) | [Quark Drive](https://pan.quark.cn/s/94ef07509df0) | Gói cài chính thức|
|
||||
| Linux | [Release](https://github.com/HBAI-Ltd/Toonflow-app/releases) | [Quark Drive](https://pan.quark.cn/s/94ef07509df0) | Gói cài chính thức|
|
||||
| macOS | [Release](https://github.com/HBAI-Ltd/Toonflow-app/releases) | [Quark Drive](https://pan.quark.cn/s/94ef07509df0) | Gói cài chính thức|
|
||||
|
||||
> [!CAUTION]
|
||||
> Đối với MacOS, vào Cài đặt - Quyền riêng tư & Bảo mật để cấu hình, nếu không phần mềm có thể không mở được do vấn đề chứng chỉ
|
||||
>
|
||||
> Tham khảo tài liệu Zhihu: [https://www.zhihu.com/question/433389276](https://www.zhihu.com/question/433389276)
|
||||
|
||||
> Do hạn chế môi trường Gitee OS và kích thước upload Release, hiện chưa cung cấp đường dẫn tải Release tại Gitee.
|
||||
|
||||
### 2. Khởi động dịch vụ
|
||||
|
||||
Cài đặt xong, mở chương trình là có thể bắt đầu sử dụng.
|
||||
|
||||
> ⚠️ **Đăng nhập lần đầu**
|
||||
> Tài khoản: `admin`
|
||||
> Mật khẩu: `admin123`
|
||||
|
||||
## Triển khai Docker
|
||||
|
||||
### Điều kiện
|
||||
|
||||
- Đã cài đặt [Docker](https://docs.docker.com/get-docker/) (version 20.10+)
|
||||
|
||||
### Cách 1: Triển khai trực tuyến
|
||||
|
||||
Đang hoàn thiện, tạm thời sử dụng build trên máy.
|
||||
|
||||
### Cách 2: Build local
|
||||
|
||||
Dùng mã nguồn sẵn có, phù hợp cho dev hoặc người đã clone repo, cần cài git trên máy:
|
||||
|
||||
```shell
|
||||
# Clone nếu chưa có
|
||||
git clone https://github.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
|
||||
# Build và khởi động bằng docker-compose
|
||||
yarn docker:local
|
||||
|
||||
# Hoặc build thủ công
|
||||
docker build -t toonflow .
|
||||
docker run -d -p <cổng máy>:10588 -v <đường dẫn data>: /app/data toonflow
|
||||
|
||||
# Sau đó, truy cập trang qua /web/index.html trên cổng phù hợp
|
||||
# Ví dụ http://localhost:10588/web/index.html
|
||||
```
|
||||
|
||||
### Giải thích cổng dịch vụ
|
||||
|
||||
| Cổng | Mục đích | Mapping deploy |
|
||||
| --------- | ------------- | ------------------- |
|
||||
| `10588` | Giao diện | `10588:10588` |
|
||||
|
||||
**Các biến môi trường:**
|
||||
|
||||
| Biến | Giải thích |
|
||||
| ----------- | -------------------------------------- |
|
||||
| `NODE_ENV` | Môi trường chạy, `prod` là production |
|
||||
| `PORT` | Cổng dịch vụ (mặc định 10588) |
|
||||
| `OSSURL` | Địa chỉ truy cập tệp tĩnh (OSS) |
|
||||
|
||||
---
|
||||
|
||||
## Triển khai trên máy chủ
|
||||
|
||||
### A. Yêu cầu máy chủ
|
||||
|
||||
- **Hệ điều hành**: Ubuntu 20.04+ / CentOS 7+
|
||||
- **Node.js**: 24.x (khuyến nghị, tối thiểu 23.11.1+)
|
||||
- **RAM**: 2GB+
|
||||
|
||||
### B. Triển khai
|
||||
|
||||
#### 1. Cài đặt môi trường
|
||||
|
||||
```bash
|
||||
# Cài Node.js
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
||||
source ~/.bashrc
|
||||
nvm install 24
|
||||
# Cài Yarn & PM2
|
||||
npm install -g yarn pm2
|
||||
```
|
||||
|
||||
#### 2. Triển khai dự án
|
||||
|
||||
**Clone từ GitHub:**
|
||||
|
||||
```bash
|
||||
cd /opt
|
||||
git clone https://github.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
yarn install
|
||||
yarn build
|
||||
```
|
||||
|
||||
**Clone từ Gitee (khuyên dùng tại VN):**
|
||||
|
||||
```bash
|
||||
cd /opt
|
||||
git clone https://gitee.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
yarn install
|
||||
yarn build
|
||||
```
|
||||
|
||||
#### 3. Cấu hình PM2
|
||||
|
||||
Tạo file `pm2.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "toonflow-app",
|
||||
"script": "data/serve/app.js",
|
||||
"instances": "max",
|
||||
"exec_mode": "cluster",
|
||||
"env": {
|
||||
"NODE_ENV": "prod",
|
||||
"PORT": 10588,
|
||||
"OSSURL": "http://127.0.0.1:10588/"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**Giải thích biến môi trường:**
|
||||
|
||||
| Biến | Giải thích |
|
||||
| ----------- | -------------------------------------- |
|
||||
| `NODE_ENV` | Môi trường chạy, `prod` là production |
|
||||
| `PORT` | Cổng dịch vụ |
|
||||
| `OSSURL` | Địa chỉ truy cập tài nguyên tĩnh |
|
||||
|
||||
---
|
||||
|
||||
#### 4. Khởi động dịch vụ
|
||||
|
||||
```bash
|
||||
pm2 start pm2.json
|
||||
pm2 startup
|
||||
pm2 save
|
||||
```
|
||||
|
||||
#### 5. Lệnh thường dùng
|
||||
|
||||
```bash
|
||||
pm2 list # Xem danh sách tiến trình
|
||||
pm2 logs toonflow-app # Xem logs
|
||||
pm2 restart all # Khởi động lại dịch vụ
|
||||
pm2 monit # Màn hình monitor
|
||||
```
|
||||
|
||||
> ⚠️ **Đăng nhập lần đầu**
|
||||
> Tài khoản: `admin`
|
||||
> Mật khẩu: `admin123`
|
||||
|
||||
#### 6. Triển khai web frontend
|
||||
|
||||
Nếu cần deploy riêng hoặc custom giao diện, tham khảo mã nguồn frontend:
|
||||
|
||||
- **GitHub**: [Toonflow-web](https://github.com/HBAI-Ltd/Toonflow-web)
|
||||
- **Gitee**: [Toonflow-web](https://gitee.com/HBAI-Ltd/Toonflow-web)
|
||||
|
||||
> 💡 **Ghi chú**: Repo này đã chứa sẵn tài nguyên frontend được build, người dùng thông thường không cần deploy thêm phần giao diện, repo frontend chỉ dành cho dev muốn tùy biến sâu.
|
||||
|
||||
---
|
||||
|
||||
# 🔧 Hướng dẫn quy trình phát triển
|
||||
|
||||
> [!CAUTION]
|
||||
> 🚧 **Quy tắc gửi PR** 🚧
|
||||
>
|
||||
> ⛔ Không nhận PR gửi thẳng vào nhánh `master` | ✅ Gửi PR vào nhánh `develop`
|
||||
>
|
||||
> Chào mừng các dev cùng góp sức phát triển Toonflow. Muốn tham gia nhóm, liên hệ admin ACT trong group chat.
|
||||
|
||||
## 🛠️ Công nghệ sử dụng
|
||||
|
||||
| Loại | Công nghệ |
|
||||
| ---------- | --------------------------------------------------------------------------------------------- |
|
||||
| Runtime | Node.js 23.11.1+ |
|
||||
| Ngôn ngữ | TypeScript 5.x |
|
||||
| Backend | Express 5 |
|
||||
| Database | SQLite (better-sqlite3/knex) |
|
||||
| Tích hợp AI| Vercel AI SDK (OpenAI/Anthropic/Google/DeepSeek/Zhipu/MiniMax/TongyiQianwen/xAI) |
|
||||
| Suy luận local| @huggingface/transformers (ONNX) |
|
||||
| Realtime | Socket.IO |
|
||||
| Desktop | Electron 40 |
|
||||
| Xử lý ảnh | Sharp |
|
||||
| Container | Docker |
|
||||
|
||||
## Chuẩn bị môi trường phát triển
|
||||
|
||||
- **Node.js**: yêu cầu >= 23.11.1
|
||||
- **Yarn**: khuyến nghị quản lý package
|
||||
|
||||
## Khởi động nhanh
|
||||
|
||||
1. **Clone dự án**
|
||||
|
||||
**Từ GitHub:**
|
||||
|
||||
```bash
|
||||
git clone https://github.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
```
|
||||
|
||||
**Từ Gitee (khuyên dùng VN):**
|
||||
|
||||
```bash
|
||||
git clone https://gitee.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
```
|
||||
|
||||
2. **Cài dependency**
|
||||
|
||||
Chạy trong thư mục gốc:
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
3. **Khởi động môi trường dev**
|
||||
|
||||
Dự án gồm 2 phần: **API backend** và **giao diện frontend**. Tuỳ bạn chọn cách chạy:
|
||||
|
||||
- **Cách 1: Chạy chỉ API backend**
|
||||
|
||||
```bash
|
||||
yarn dev
|
||||
```
|
||||
|
||||
> ⚠️ Lệnh này chỉ khởi động API backend (port 10588), **không gồm frontend** và truy cập `http://localhost:10588` chỉ gọi được API, không có web. Nếu muốn vừa backend vừa giao diện web, chạy GUI hoặc deploy bổ sung frontend.
|
||||
|
||||
- **Cách 2: Chạy GUI ứng dụng desktop Electron**
|
||||
|
||||
```bash
|
||||
yarn dev:gui
|
||||
```
|
||||
|
||||
> Lệnh này khởi động backend đồng thời mở cửa sổ desktop Electron có build frontend sẵn, dùng liền, không cấu hình gì thêm. Dành cho dev muốn trải nghiệm trọn bộ.
|
||||
|
||||
- **Cách 3: Chạy chế độ production**
|
||||
|
||||
```bash
|
||||
yarn start
|
||||
```
|
||||
|
||||
> Chạy trực tiếp bản build (cần build bằng `yarn build` trước).
|
||||
|
||||
4. **Đóng gói dự án**
|
||||
|
||||
- Biên dịch TypeScript:
|
||||
|
||||
```bash
|
||||
yarn build
|
||||
```
|
||||
|
||||
- Đóng gói thành exe Windows:
|
||||
|
||||
```bash
|
||||
yarn dist:win
|
||||
```
|
||||
|
||||
- Đóng gói MacOS:
|
||||
|
||||
```bash
|
||||
yarn dist:mac
|
||||
```
|
||||
|
||||
- Đóng gói Linux:
|
||||
|
||||
```bash
|
||||
yarn dist:linux
|
||||
```
|
||||
|
||||
5. **Kiểm tra chất lượng code**
|
||||
|
||||
- Đánh giá tổng thể chuẩn code:
|
||||
|
||||
```bash
|
||||
yarn lint
|
||||
```
|
||||
|
||||
6. **Bảng debug AI (tùy chọn)**
|
||||
|
||||
Khởi động bảng debug AI SDK, dễ test AI call:
|
||||
|
||||
```bash
|
||||
yarn debug:ai
|
||||
```
|
||||
|
||||
## Phát triển Frontend
|
||||
|
||||
Nếu muốn chỉnh sửa UI, vào repo frontend:
|
||||
|
||||
- **GitHub**: [Toonflow-web](https://github.com/HBAI-Ltd/Toonflow-web)
|
||||
- **Gitee**: [Toonflow-web](https://gitee.com/HBAI-Ltd/Toonflow-web)
|
||||
|
||||
Sau khi build frontend, copy thư mục `dist` vào `data/web` của repo này để tích hợp.
|
||||
|
||||
## Cấu trúc dự án
|
||||
|
||||
```
|
||||
📂 build/ # File build
|
||||
📂 data/ # Dữ liệu runtime
|
||||
│ ├─ 📂 models/ # Model local (ONNX)
|
||||
│ ├─ 📂 oss/ # Lưu trữ asset (media/nhân vật/cảnh)
|
||||
│ ├─ 📂 serve/ # Entry prod
|
||||
│ ├─ 📂 skills/ # Prompt kỹ năng Agent
|
||||
│ └─ 📂 web/ # Thành phẩm frontend (built-in)
|
||||
📂 docs/ # Tài liệu
|
||||
📂 env/ # Cấu hình môi trường
|
||||
📂 scripts/ # Script build & phụ trợ
|
||||
📂 src/
|
||||
├─ 📂 agents/ # Module AI Agent
|
||||
│ ├─ 📂 productionAgent/ # Agent sản xuất
|
||||
│ └─ 📂 scriptAgent/ # Agent kịch bản
|
||||
├─ 📂 lib/ # Thư viện chung (init db, response...)
|
||||
├─ 📂 middleware/ # Middleware
|
||||
├─ 📂 routes/ # Router các module
|
||||
│ ├─ 📂 agents/ # Quản lý memory Agent
|
||||
│ ├─ 📂 artStyle/ # Quản lý style tranh
|
||||
│ ├─ 📂 assets/ # Asset
|
||||
│ ├─ 📂 assetsGenerate/ # Sinh asset
|
||||
│ ├─ 📂 cornerScape/ # Quản lý phân cảnh
|
||||
│ ├─ 📂 general/ # API chung
|
||||
│ ├─ 📂 login/ # Đăng nhập/ xác thực
|
||||
│ ├─ 📂 migrate/ # Di trú dữ liệu
|
||||
│ ├─ 📂 modelSelect/ # Chọn model AI
|
||||
│ ├─ 📂 novel/ # Quản lý tiểu thuyết
|
||||
│ ├─ 📂 other/ # Chức năng khác
|
||||
│ ├─ 📂 production/ # Quản lý sản xuất
|
||||
│ ├─ 📂 project/ # Quản lý project
|
||||
│ ├─ 📂 script/ # Tạo kịch bản
|
||||
│ ├─ 📂 scriptAgent/ # API Agent kịch bản
|
||||
│ ├─ 📂 setting/ # Thiết lập hệ thống
|
||||
│ ├─ 📂 task/ # Quản lý task
|
||||
│ └─ 📂 test/ # API test
|
||||
├─ 📂 socket/ # WebSocket realtime
|
||||
├─ 📂 types/ # Định nghĩa TypeScript
|
||||
├─ 📂 utils/ # Hàm tiện ích
|
||||
├─ 📄 app.ts # App entry
|
||||
├─ 📄 core.ts # Init core
|
||||
├─ 📄 env.ts # Xử lý biến môi trường
|
||||
├─ 📄 err.ts # Xử lý lỗi
|
||||
├─ 📄 logger.ts # Ghi log
|
||||
├─ 📄 router.ts # Đăng ký routes
|
||||
└─ 📄 utils.ts # Tiện ích chung
|
||||
📄 Dockerfile # Build Docker
|
||||
📄 electron-builder.yml # Cấu hình build Electron
|
||||
📄 skillList.json # Danh sách skill
|
||||
📄 LICENSE # License (Apache-2.0)
|
||||
📄 NOTICES.txt # Ghi chú phụ thuộc third-party
|
||||
📄 package.json # Cấu hình dự án
|
||||
📄 tsconfig.json # Cấu hình TypeScript
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
# 🔗 Repo liên quan
|
||||
|
||||
| Repo | Giải thích | GitHub | Gitee |
|
||||
| ---------------- | -------------------------------- | -------------------------------------------------- | ------------------------------------------------ |
|
||||
| **Toonflow-app** | Ứng dụng client đầy đủ (repo này, người dùng nên dùng) | [GitHub](https://github.com/HBAI-Ltd/Toonflow-app) | [Gitee](https://gitee.com/HBAI-Ltd/Toonflow-app) |
|
||||
| **Toonflow-web** | Mã nguồn frontend (cho dev UI) | [GitHub](https://github.com/HBAI-Ltd/Toonflow-web) | [Gitee](https://gitee.com/HBAI-Ltd/Toonflow-web) |
|
||||
|
||||
> 💡 **Lưu ý**: Nếu chỉ muốn dùng Toonflow, tải về client repo này là đủ. Repo frontend chỉ dành cho ai cần phát triển/custome UI thêm.
|
||||
|
||||
---
|
||||
|
||||
# 👨👩👧👦 Nhóm chat WeChat
|
||||
|
||||
~~Nhóm 1~~
|
||||
|
||||
~~Nhóm 2~~
|
||||
|
||||
...
|
||||
|
||||
~~Nhóm 10~~
|
||||
|
||||
~~Nhóm 11~~
|
||||
|
||||
~~Nhóm 12~~
|
||||
|
||||
~~Nhóm 13~~
|
||||
|
||||
...
|
||||
|
||||
~~Nhóm 24~~
|
||||
|
||||
Bot mời tham gia:
|
||||
|
||||
<img src="./QR.png" alt="Toonflow QR" height="400"/>
|
||||
|
||||
---
|
||||
|
||||
# 💌 Liên hệ
|
||||
|
||||
📧 Email: [ltlctools@outlook.com](mailto:ltlctools@outlook.com?subject=Toonflow咨询)
|
||||
|
||||
---
|
||||
|
||||
# 📜 Giấy phép
|
||||
|
||||
Toonflow phát hành mã nguồn mở theo Apache-2.0, kèm thỏa thuận thương mại bổ sung.
|
||||
|
||||
Chi tiết: https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
## Thỏa thuận bổ sung
|
||||
|
||||
- Nếu phân phối phần mềm này dưới dạng sản phẩm cho **2 bên thứ ba độc lập trở lên**, bạn phải có **ủy quyền thương mại bằng văn bản** từ HBAI-Ltd.
|
||||
- **≤ 5 pháp nhân** cùng vận hành nội bộ mà không cung cấp dịch vụ ra bên ngoài được coi là **sử dụng nội bộ, không cần ủy quyền**.
|
||||
- Không được xóa hoặc sửa đổi nhãn hiệu, logo hoặc thông tin bản quyền trong Toonflow.
|
||||
|
||||
## Miễn phí vĩnh viễn
|
||||
|
||||
- ✅ Sử dụng Toonflow tạo nội dung và nhận chia sẻ doanh thu nền tảng
|
||||
- ✅ Phát triển thêm cho sử dụng nội bộ nhóm
|
||||
- ✅ ≤ 5 pháp nhân vận hành chung nội bộ
|
||||
- ✅ Học tập cá nhân, nghiên cứu, mục đích phi thương mại
|
||||
|
||||
## Bảng giá ủy quyền thương mại
|
||||
|
||||
| Giai đoạn | Doanh thu năm | Phí hàng năm |
|
||||
|------|---------|------|
|
||||
| 🌱 Ươm tạo | < ¥100,000 | **Miễn phí** |
|
||||
| 🚀 Khởi nghiệp | ¥100,000–500,000 | ¥5,000/năm |
|
||||
| 📈 Tăng trưởng | ¥500,000–1,500,000 | ¥20,000/năm |
|
||||
| 🏢 Mở rộng | ¥1,500,000–5,000,000 | ¥80,000/năm |
|
||||
| 🌐 Doanh nghiệp | > ¥5,000,000 | Thương lượng |
|
||||
|
||||
> **Điều khoản không hồi tố**: Người dùng đã sử dụng Toonflow theo AGPL-3.0 trước khi phát hành v1.0.8 không bị ảnh hưởng. Việc sử dụng hiện tại tiếp tục theo AGPL-3.0.
|
||||
|
||||
Xem thỏa thuận đầy đủ tại [LICENSE](../LICENSE).
|
||||
|
||||
---
|
||||
|
||||
# ⭐️ Lịch sử đánh dấu sao
|
||||
|
||||
[](https://www.star-history.com/#HBAI-Ltd/Toonflow-app&type=timeline&legend=top-left)
|
||||
|
||||
---
|
||||
|
||||
# 🙏 Lời cảm ơn
|
||||
|
||||
Cảm ơn các dự án open source sau đã hỗ trợ Toonflow mạnh mẽ:
|
||||
|
||||
- [Express](https://expressjs.com/) - Framework Web Node.js nhanh, mở, gọn nhẹ
|
||||
- [AI SDK](https://ai-sdk.dev/) - Bộ tool AI cho TypeScript
|
||||
- [Better-SQLite3](https://github.com/WiseLibs/better-sqlite3) - Bindings SQLite3 hiệu năng cao
|
||||
- [Sharp](https://sharp.pixelplumbing.com/) - Thư viện xử lý ảnh Node.js nhanh
|
||||
- [Axios](https://axios-http.com/) - HTTP client dựa trên Promise
|
||||
- [Zod](https://zod.dev/) - Library kiểm tra schema ưu tiên TypeScript
|
||||
- [Socket.IO](https://socket.io/) - Engine realtime song phương sự kiện
|
||||
- [Electron](https://www.electronjs.org/) - Framework phát triển desktop app đa nền tảng
|
||||
- [Hugging Face Transformers](https://huggingface.co/docs/transformers.js) - Thư viện infer ML local
|
||||
|
||||
Cảm ơn các tổ chức/đơn vị/cá nhân sau đã hỗ trợ Toonflow:
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="./sponsored/sophnet.png" alt="算能云 Logo" width="48">
|
||||
</td>
|
||||
<td>
|
||||
<b>Suanneng Cloud</b> tài trợ năng lực tính toán
|
||||
<a href="https://www.sophnet.com/">[Trang chủ]</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
Danh sách phụ thuộc bên thứ ba, vui lòng xem `NOTICES.txt`
|
||||
|
||||
588
docs/README.zhtw.md
Normal file
@ -0,0 +1,588 @@
|
||||
<p>
|
||||
<a href="https://github.com/HBAI-Ltd/Toonflow-app">
|
||||
<img src="https://img.shields.io/badge/GitHub-181717?style=flat-square&logo=github&logoColor=white" alt="GitHub" />
|
||||
</a>
|
||||
|
|
||||
<a href="https://gitee.com/HBAI-Ltd/Toonflow-app">
|
||||
<img src="https://img.shields.io/badge/Gitee-C71D23?style=flat-square&logo=gitee&logoColor=white" alt="Gitee" />
|
||||
</a>
|
||||
|
|
||||
<a href="https://gitcode.com/HBAI-Ltd/Toonflow-app">
|
||||
<img src="./atomgitLogo.png" alt="Atomgit" style="height:16px"/>
|
||||
Atomgit
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="../README.md">简体中文</a> |
|
||||
<strong>繁體中文</strong> |
|
||||
<a href="./README.en.md">English</a> |
|
||||
<a href="./README.en.md">ไทย</a> |
|
||||
<a href="./README.en.md">Tiếng Việt</a> |
|
||||
<a href="./README.en.md">日本語</a> |
|
||||
<a href="./README.en.md">Русский</a>
|
||||
</p>
|
||||
|
||||
<div align="center">
|
||||
|
||||
<img src="./logo.png" alt="Toonflow Logo" height="120"/>
|
||||
|
||||
# Toonflow
|
||||
|
||||
<p align="center">
|
||||
<b>
|
||||
AI短劇工廠
|
||||
<br />
|
||||
一鍵點擊,小說秒變短劇!
|
||||
<br />
|
||||
AI劇本 × AI視覺 × 渦輪生成 🔥
|
||||
</b>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://github.com/HBAI-Ltd/Toonflow-app/stargazers">
|
||||
<img src="https://img.shields.io/github/stars/HBAI-Ltd/Toonflow-app?style=for-the-badge&logo=github" alt="Stars Badge" />
|
||||
</a>
|
||||
<a href="https://www.apache.org/licenses/LICENSE-2.0" target="_blank">
|
||||
<img src="https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=for-the-badge" alt="Apache-2.0 License Badge" />
|
||||
</a>
|
||||
<a href="https://github.com/HBAI-Ltd/Toonflow-app/releases">
|
||||
<img alt="release" src="https://img.shields.io/github/v/release/HBAI-Ltd/Toonflow-app?style=for-the-badge" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
> 🚀 **一站式短劇生產**:從文本到人物、從分鏡到影片,零門檻全流程AI,10倍以上創作效率!
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
# 🌟 主要功能
|
||||
|
||||
Toonflow 是一款AI短劇漫畫工具,利用AI自動將小說轉換為劇本,並用AI生成圖片、視頻,助力高效短劇製作。有了Toonflow,您可輕鬆完成從文本到圖片的全流程操作,讓短劇製作更智能、更便捷。
|
||||
|
||||
- ✅ **人物生成**
|
||||
自動解析原小說文本,智能識別並生成人物設定,包括外貌、性格、身份等,為後續劇本和視覺創作提供穩固基礎。
|
||||
- ✅ **劇本生成**
|
||||
根據所選事件和章節,系統自動生成結構化劇本,涵蓋對話、場景描述、劇情走向,實現文學文本向影視劇本高效轉化。
|
||||
- ✅ **分鏡製作**
|
||||
根據劇本內容,智能生成分鏡提示與視覺設計,細化前景/中景/背景、人物動態、道具設定與場景佈局,自動將劇本轉換為分鏡,為影片製作提供完整藍圖。
|
||||
- ✅ **影片合成**
|
||||
集成AI圖像與視頻技術,通過AI生成視頻片段,支持線上編輯與個性化輸出調整,讓影視製作協同高效。
|
||||
|
||||
---
|
||||
|
||||
# 📦 應用場景
|
||||
|
||||
- 短視頻內容創作
|
||||
- 小說改編影視實驗
|
||||
- AI文學改編工具
|
||||
- 劇本開發與快速原型
|
||||
- 影片素材生成
|
||||
|
||||
---
|
||||
|
||||
# 🔰 用戶指南
|
||||
|
||||
## 📺 視頻教程
|
||||
|
||||
https://www.bilibili.com/video/BV1na6wB6Ea2
|
||||
[](https://www.bilibili.com/video/BV1na6wB6Ea2)
|
||||
|
||||
**Toonflow 8分鐘快速上手AI視頻**
|
||||
👉 [點此觀看](https://www.bilibili.com/video/BV1na6wB6Ea2/?share_source=copy_web&vd_source=5b718c25439a901a34c7bc0c1d35b38e)
|
||||
|
||||
📱 用手機微信掃碼觀看
|
||||
|
||||
<img src="./videoQR.png" alt="Scan WeChat to Watch" width="150"/>
|
||||
|
||||
---
|
||||
|
||||
# 🚀 安裝方法
|
||||
|
||||
## 前置準備
|
||||
|
||||
安裝與使用前請準備以下內容:
|
||||
|
||||
- ✅ 大語言模型AI服務API地址
|
||||
- ✅ Sora或豆包視頻服務API地址
|
||||
- ✅ Nano Banana Pro圖像生成模型API
|
||||
|
||||
## 本地安裝
|
||||
|
||||
### 1. 下載安裝
|
||||
|
||||
| 作業系統 | GitHub下載 | Quark雲下載 | 備註 |
|
||||
| :------------: | :------------------------------------------------------ | :---------------------------------------------- | :------------- |
|
||||
| Windows | [釋出版](https://github.com/HBAI-Ltd/Toonflow-app/releases) | [Quark雲](https://pan.quark.cn/s/94ef07509df0) | 官方安裝包 |
|
||||
| Linux | [釋出版](https://github.com/HBAI-Ltd/Toonflow-app/releases) | [Quark雲](https://pan.quark.cn/s/94ef07509df0) | 官方安裝包 |
|
||||
| macOS | [釋出版](https://github.com/HBAI-Ltd/Toonflow-app/releases) | [Quark雲](https://pan.quark.cn/s/94ef07509df0) | 官方安裝包 |
|
||||
|
||||
> [!CAUTION]
|
||||
> MacOS上需進入設定–隱私安全配置安全設定,否則可能因憑證問題無法打開應用。
|
||||
>
|
||||
> 參考知乎文檔:[https://www.zhihu.com/question/433389276](https://www.zhihu.com/question/433389276)
|
||||
|
||||
> 受Gitee作業系統環境與釋出檔案大小限制,目前Gitee釋出下載暫不開放。
|
||||
|
||||
### 2. 啟動服務
|
||||
|
||||
安裝完成後,啟動程式即可開始使用本服務。
|
||||
|
||||
> ⚠️ **首次登入**
|
||||
> 用戶名:`admin`
|
||||
> 密碼:`admin123`
|
||||
|
||||
## Docker部署
|
||||
|
||||
### 前置準備
|
||||
|
||||
- 已安裝 [Docker](https://docs.docker.com/get-docker/)(20.10+)
|
||||
|
||||
### 方法一:線上部署
|
||||
|
||||
待開發,現請使用本地構建。
|
||||
|
||||
### 方法二:本地構建
|
||||
|
||||
適用於開發者或已克隆源碼的用戶,需本地安裝Git:
|
||||
|
||||
```shell
|
||||
# 克隆專案(已克隆則略過)
|
||||
git clone https://github.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
|
||||
# 用docker-compose本地構建啟動
|
||||
yarn docker:local
|
||||
|
||||
# 或手動構建
|
||||
docker build -t toonflow .
|
||||
docker run -d -p <local_port>:10588 -v <local_data_path>:/app/data toonflow
|
||||
|
||||
# 完成後可通過映射端口/web/index.html訪問
|
||||
# 如 http://localhost:10588/web/index.html
|
||||
```
|
||||
|
||||
### 服務端口說明
|
||||
|
||||
| 端口 | 用途 | 部署映射 |
|
||||
| -------- |------------| -------------------- |
|
||||
| `10588` | 應用介面 | `10588:10588` |
|
||||
|
||||
**環境變數說明:**
|
||||
|
||||
| 變數 | 說明 |
|
||||
| -------------- | ------------------------------------------ |
|
||||
| `NODE_ENV` | 環境,生產用`prod` |
|
||||
| `PORT` | 服務監聽端口(預設10588) |
|
||||
| `OSSURL` | 靜態檔案存取地址 |
|
||||
|
||||
---
|
||||
|
||||
## 雲端部署
|
||||
|
||||
### 1. 伺服器需求
|
||||
|
||||
- **作業系統:** Ubuntu 20.04+ / CentOS 7+
|
||||
- **Node.js:** 24.x(推薦,最低23.11.1+)
|
||||
- **記憶體:** 2GB+
|
||||
|
||||
### 2. 伺服器部署
|
||||
|
||||
#### 1. 安裝環境
|
||||
|
||||
```bash
|
||||
# 安裝Node.js
|
||||
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
|
||||
source ~/.bashrc
|
||||
nvm install 24
|
||||
# 安裝Yarn與PM2
|
||||
npm install -g yarn pm2
|
||||
```
|
||||
|
||||
#### 2. 專案部署
|
||||
|
||||
**GitHub克隆:**
|
||||
|
||||
```bash
|
||||
cd /opt
|
||||
git clone https://github.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
yarn install
|
||||
yarn build
|
||||
```
|
||||
|
||||
**Gitee克隆(中國大陸推薦):**
|
||||
|
||||
```bash
|
||||
cd /opt
|
||||
git clone https://gitee.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
yarn install
|
||||
yarn build
|
||||
```
|
||||
|
||||
#### 3. 配置PM2
|
||||
|
||||
新建`pm2.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"name": "toonflow-app",
|
||||
"script": "data/serve/app.js",
|
||||
"instances": "max",
|
||||
"exec_mode": "cluster",
|
||||
"env": {
|
||||
"NODE_ENV": "prod",
|
||||
"PORT": 10588,
|
||||
"OSSURL": "http://127.0.0.1:10588/"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**環境變數說明:**
|
||||
|
||||
| 變數 | 說明 |
|
||||
| -------------- | ------------------------------------------ |
|
||||
| `NODE_ENV` | 環境,生產用`prod` |
|
||||
| `PORT` | 服務監聽端口 |
|
||||
| `OSSURL` | 靜態檔案存取地址 |
|
||||
|
||||
---
|
||||
|
||||
#### 4. 啟動服務
|
||||
|
||||
```bash
|
||||
pm2 start pm2.json
|
||||
pm2 startup
|
||||
pm2 save
|
||||
```
|
||||
|
||||
#### 5. 常用命令
|
||||
|
||||
```bash
|
||||
pm2 list # 查看進程列表
|
||||
pm2 logs toonflow-app # 查看日誌
|
||||
pm2 restart all # 重啟服務
|
||||
pm2 monit # 監控面板
|
||||
```
|
||||
|
||||
> ⚠️ **首次登入**
|
||||
> 用戶名:`admin`
|
||||
> 密碼:`admin123`
|
||||
|
||||
#### 6. 前端網站部署
|
||||
|
||||
若需單獨部署前端或自定義,參見前端專案:
|
||||
|
||||
- **GitHub**: [Toonflow-web](https://github.com/HBAI-Ltd/Toonflow-web)
|
||||
- **Gitee**: [Toonflow-web](https://gitee.com/HBAI-Ltd/Toonflow-web)
|
||||
|
||||
> 💡 **注意:** 本專案已預設內建前端,普通用戶無需單獨部署。前端源碼主要供開發者二次開發使用。
|
||||
|
||||
---
|
||||
|
||||
# 🔧 開發指南
|
||||
|
||||
> [!CAUTION]
|
||||
> 🚧 **PR提交規範** 🚧
|
||||
>
|
||||
> ⛔ `master`分支不接受PR | ✅ 請提交至`develop`分支
|
||||
>
|
||||
> 歡迎開發者協同合作,共同開發Toonflow。欲加入請聯繫owner ACT入群。
|
||||
|
||||
## 🛠️ 技術棧
|
||||
|
||||
| 分類 | 技術 |
|
||||
| ----------- | -------------------------------------------------------------------------------------- |
|
||||
| 運行環境 | Node.js 23.11.1+ |
|
||||
| 語言 | TypeScript 5.x |
|
||||
| 後端 | Express 5 |
|
||||
| 資料庫 | SQLite(better-sqlite3 / knex) |
|
||||
| AI接入 | Vercel AI SDK(OpenAI / Anthropic / Google / DeepSeek / 智譜 / MiniMax / Qwen / xAI)|
|
||||
| 本地推理 | @huggingface/transformers(ONNX) |
|
||||
| 實時通信 | Socket.IO |
|
||||
| 桌面端 | Electron 40 |
|
||||
| 影像處理 | Sharp |
|
||||
| 容器化 | Docker |
|
||||
|
||||
## 開發環境準備
|
||||
|
||||
- **Node.js**:需23.11.1以上版本
|
||||
- **Yarn**:推薦作為包管理器
|
||||
|
||||
## 快速上手
|
||||
|
||||
1. **克隆專案**
|
||||
|
||||
**GitHub克隆:**
|
||||
|
||||
```bash
|
||||
git clone https://github.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
```
|
||||
|
||||
**Gitee克隆(大陸推薦):**
|
||||
|
||||
```bash
|
||||
git clone https://gitee.com/HBAI-Ltd/Toonflow-app.git
|
||||
cd Toonflow-app
|
||||
```
|
||||
|
||||
2. **安裝依賴**
|
||||
|
||||
在專案根目錄執行:
|
||||
|
||||
```bash
|
||||
yarn install
|
||||
```
|
||||
|
||||
3. **啟動開發環境**
|
||||
|
||||
本專案包含 **後端API服務** 和 **前端介面**,按需啟動:
|
||||
|
||||
- **方案1:僅啟動後端服務**
|
||||
|
||||
```bash
|
||||
yarn dev
|
||||
```
|
||||
|
||||
> ⚠️ 此命令僅啟動後端API(10588端口),沒有Web介面。僅可存取API,完整UI需啟動前端專案或用下述GUI模式。
|
||||
|
||||
- **方案2:啟動Electron桌面客戶端**
|
||||
|
||||
```bash
|
||||
yarn dev:gui
|
||||
```
|
||||
|
||||
> 此命令即啟動後端又開Electron視窗,內建Web UI。開箱即用,體驗完整。
|
||||
|
||||
- **方案3:生產模式啟動**
|
||||
|
||||
```bash
|
||||
yarn start
|
||||
```
|
||||
|
||||
> 編譯後以生產模式運行(需先執行`yarn build`)。
|
||||
|
||||
4. **構建專案**
|
||||
|
||||
- 編譯TypeScript:
|
||||
|
||||
```bash
|
||||
yarn build
|
||||
```
|
||||
|
||||
- Windows可執行檔打包:
|
||||
|
||||
```bash
|
||||
yarn dist:win
|
||||
```
|
||||
|
||||
- Mac打包:
|
||||
|
||||
```bash
|
||||
yarn dist:mac
|
||||
```
|
||||
|
||||
- Linux打包:
|
||||
|
||||
```bash
|
||||
yarn dist:linux
|
||||
```
|
||||
|
||||
5. **代碼質量檢查**
|
||||
|
||||
- 執行Lint:
|
||||
|
||||
```bash
|
||||
yarn lint
|
||||
```
|
||||
|
||||
6. **AI調試面板(可選)**
|
||||
|
||||
啟動Vercel AI SDK可視化調試工具,便於AI對接調測:
|
||||
|
||||
```bash
|
||||
yarn debug:ai
|
||||
```
|
||||
|
||||
## 前端開發
|
||||
|
||||
需修改前端UI,請於專用前端專案開發:
|
||||
|
||||
- **GitHub**: [Toonflow-web](https://github.com/HBAI-Ltd/Toonflow-web)
|
||||
- **Gitee**: [Toonflow-web](https://gitee.com/HBAI-Ltd/Toonflow-web)
|
||||
|
||||
前端打包後將`dist`內容複製至本專案`data/web`即可集成。
|
||||
|
||||
## 專案結構
|
||||
|
||||
```
|
||||
📂 build/ # 編譯產物
|
||||
📂 data/ # 運行時資料
|
||||
│ ├─ 📂 models/ # 本地推理模型(ONNX)
|
||||
│ ├─ 📂 oss/ # 物件儲存(素材/角色/場景)
|
||||
│ ├─ 📂 serve/ # 生產模式入口
|
||||
│ ├─ 📂 skills/ # Agent技能提示
|
||||
│ └─ 📂 web/ # 前端資產
|
||||
📂 ./ # 文檔資產
|
||||
📂 env/ # 環境配置
|
||||
📂 scripts/ # 構建與輔助腳本
|
||||
📂 src/
|
||||
├─ 📂 agents/ # AI Agent模組
|
||||
│ ├─ 📂 productionAgent/ # 製作Agent
|
||||
│ └─ 📂 scriptAgent/ # 劇本Agent
|
||||
├─ 📂 lib/ # 通用庫(資料庫、響應)
|
||||
├─ 📂 middleware/ # 中間件
|
||||
├─ 📂 routes/ # API路由
|
||||
│ ├─ 📂 agents/ # Agent記憶管理
|
||||
│ ├─ 📂 artStyle/ # 美術風格管理
|
||||
│ ├─ 📂 assets/ # 素材管理
|
||||
│ ├─ 📂 assetsGenerate/ # 素材生成
|
||||
│ ├─ 📂 cornerScape/ # 分鏡管理
|
||||
│ ├─ 📂 general/ # 通用API
|
||||
│ ├─ 📂 login/ # 認證
|
||||
│ ├─ 📂 migrate/ # 資料遷移
|
||||
│ ├─ 📂 modelSelect/ # 模型選擇
|
||||
│ ├─ 📂 novel/ # 小說管理
|
||||
│ ├─ 📂 other/ # 其他功能
|
||||
│ ├─ 📂 production/ # 製作管理
|
||||
│ ├─ 📂 project/ # 專案管理
|
||||
│ ├─ 📂 script/ # 劇本生成
|
||||
│ ├─ 📂 scriptAgent/ # 劇本Agent API
|
||||
│ ├─ 📂 setting/ # 系統設定
|
||||
│ ├─ 📂 task/ # 任務管理
|
||||
│ └─ 📂 test/ # 測試API
|
||||
├─ 📂 socket/ # WebSocket通訊
|
||||
├─ 📂 types/ # TypeScript型別
|
||||
├─ 📂 utils/ # 工具函式
|
||||
├─ 📄 app.ts # 應用入口
|
||||
├─ 📄 core.ts # 核心初始化
|
||||
├─ 📄 env.ts # 環境變數
|
||||
├─ 📄 err.ts # 錯誤處理
|
||||
├─ 📄 logger.ts # 日誌模組
|
||||
├─ 📄 router.ts # 路由註冊
|
||||
└─ 📄 utils.ts # 通用工具
|
||||
📄 Dockerfile # Docker構建
|
||||
📄 electron-builder.yml # Electron打包配置
|
||||
📄 skillList.json # 技能列表
|
||||
📄 LICENSE # (Apache-2.0) 授權
|
||||
📄 NOTICES.txt # 第三方依賴
|
||||
📄 package.json # 專案配置
|
||||
📄 tsconfig.json # TypeScript配置
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
# 🔗 相關倉庫
|
||||
|
||||
| 倉庫 | 說明 | GitHub | Gitee |
|
||||
| -------------- | -------------------------- | ------------------------------------------------- | -------------------------------------------------- |
|
||||
| **Toonflow-app** | 完整客戶端(本倉庫,供用戶) | [GitHub](https://github.com/HBAI-Ltd/Toonflow-app)| [Gitee](https://gitee.com/HBAI-Ltd/Toonflow-app) |
|
||||
| **Toonflow-web** | 前端源碼(前端開發者用) | [GitHub](https://github.com/HBAI-Ltd/Toonflow-web)| [Gitee](https://gitee.com/HBAI-Ltd/Toonflow-web) |
|
||||
|
||||
> 💡 **提醒:** 若僅需使用Toonflow,直接下載本倉庫客戶端即可。前端源碼僅供需二次開發或UI自訂者使用。
|
||||
|
||||
---
|
||||
|
||||
# 👨👩👧👦 微信交流群
|
||||
|
||||
~~群1~~
|
||||
|
||||
~~群2~~
|
||||
|
||||
...
|
||||
|
||||
~~群10~~
|
||||
|
||||
~~群11~~
|
||||
|
||||
~~群12~~
|
||||
|
||||
~~群13~~
|
||||
|
||||
...
|
||||
|
||||
~~群24~~
|
||||
|
||||
群助手:
|
||||
|
||||
<img src="./QR.png" alt="Toonflow QR" height="400"/>
|
||||
|
||||
---
|
||||
|
||||
# 💌 聯繫我們
|
||||
|
||||
📧 郵箱:[ltlctools@outlook.com](mailto:ltlctools@outlook.com?subject=Toonflow inquiry)
|
||||
|
||||
---
|
||||
|
||||
# 📜 開源協議
|
||||
|
||||
Toonflow 基於 Apache-2.0 協議開源發布,並附有補充商業協議。
|
||||
|
||||
授權詳情:https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
## 補充協議
|
||||
|
||||
- 若將本軟體以產品形式分發給 **2 個及以上獨立第三方**使用,須取得 HBAI-Ltd **書面商業授權**。
|
||||
- **≤ 5 個法人**聯合運營內部使用,不對外提供服務的,視為內部使用,**無需授權**。
|
||||
- 不得刪除或修改 Toonflow 中的標識或版權資訊。
|
||||
|
||||
## 永久免費場景
|
||||
|
||||
- ✅ 用 Toonflow 製作內容並獲得平台分帳
|
||||
- ✅ 二次開發供自己團隊內部使用
|
||||
- ✅ ≤ 5 個法人聯合運營內部使用
|
||||
- ✅ 個人學習、研究、非商業用途
|
||||
|
||||
## 商業授權定價
|
||||
|
||||
| 階段 | 年銷售額 | 年費 |
|
||||
|------|---------|------|
|
||||
| 🌱 扶持期 | < ¥10 萬 | **免費** |
|
||||
| 🚀 初創期 | ¥10–50 萬 | ¥5,000/年 |
|
||||
| 📈 成長期 | ¥50–150 萬 | ¥20,000/年 |
|
||||
| 🏢 規模期 | ¥150–500 萬 | ¥80,000/年 |
|
||||
| 🌐 企業級 | > ¥500 萬 | 面議 |
|
||||
|
||||
> **不追溯條款**:v1.0.8 發布前基於 AGPL-3.0 使用的用戶,繼續按 AGPL-3.0 執行,不受本協議變更約束。
|
||||
|
||||
完整協議詳見 [LICENSE](../LICENSE) 檔案。
|
||||
|
||||
---
|
||||
|
||||
# ⭐️ Star 歷史
|
||||
|
||||
[](https://www.star-history.com/#HBAI-Ltd/Toonflow-app&type=timeline&legend=top-left)
|
||||
|
||||
---
|
||||
|
||||
# 🙏 感謝
|
||||
|
||||
感謝以下開源專案對Toonflow的支持:
|
||||
|
||||
- [Express](https://expressjs.com/) - 快速、開放、極簡的Node.js Web框架
|
||||
- [AI SDK](https://ai-sdk.dev/) - TypeScript優先的AI工具包
|
||||
- [Better-SQLite3](https://github.com/WiseLibs/better-sqlite3) - 高效能SQLite3綁定
|
||||
- [Sharp](https://sharp.pixelplumbing.com/) - Node.js高性能影像工具
|
||||
- [Axios](https://axios-http.com/) - Promise的HTTP用戶端
|
||||
- [Zod](https://zod.dev/) - TypeScript優先的型別驗證庫
|
||||
- [Socket.IO](https://socket.io/) - 實時雙向事件框架
|
||||
- [Electron](https://www.electronjs.org/) - 跨平台桌面應用框架
|
||||
- [Hugging Face Transformers](https://huggingface.co./transformers.js) - 本地ML推理庫
|
||||
|
||||
感謝以下組織/個人的支持:
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<img src="./sponsored/sophnet.png" alt="SophNet Logo" width="48">
|
||||
</td>
|
||||
<td>
|
||||
<b>SophNet Cloud</b> 提供算力贊助
|
||||
<a href="https://www.sophnet.com/">[官方網站]</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
完整第三方依賴列表請見 `NOTICES.txt`
|
||||
BIN
docs/atomgitLogo.png
Normal file
|
After Width: | Height: | Size: 848 B |
|
Before Width: | Height: | Size: 260 KiB |
|
Before Width: | Height: | Size: 254 KiB |
|
Before Width: | Height: | Size: 254 KiB |
|
Before Width: | Height: | Size: 172 KiB |
BIN
docs/chat8QR.jpg
|
Before Width: | Height: | Size: 169 KiB |
BIN
docs/chat9QR.jpg
|
Before Width: | Height: | Size: 257 KiB |
BIN
docs/logo.png
|
Before Width: | Height: | Size: 705 KiB After Width: | Height: | Size: 71 KiB |
@ -3,6 +3,7 @@
|
||||
"version": "1.0.8",
|
||||
"description": "Toonflow 是一款 AI 短剧漫剧工具,能够利用 AI 技术将小说自动转化为剧本,并结合 AI 生成的图片和视频,实现高效的短剧创作。",
|
||||
"author": "HBAI-Ltd <ltlctools@outlook.com>",
|
||||
"license": "Apache-2.0",
|
||||
"homepage": "https://github.com/HBAI-Ltd/Toonflow-app#readme",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -21,6 +22,7 @@
|
||||
"dev": "nodemon --inspect --exec tsx src/app.ts",
|
||||
"dev:gui": "electronmon -r tsx scripts/main.ts",
|
||||
"dev:gui-vite": "cross-env VITE_DEV=1 electronmon -r tsx scripts/main.ts",
|
||||
"start": "cross-env NODE_ENV=prod node data/serve/app.js",
|
||||
"lint": "tsc --noEmit",
|
||||
"build": "cross-env NODE_ENV=prod tsx scripts/build.ts",
|
||||
"pack": "electron-builder --dir",
|
||||
@ -28,9 +30,6 @@
|
||||
"dist:win": "yarn build && electron-builder --win",
|
||||
"dist:mac": "yarn build && electron-builder --mac",
|
||||
"dist:linux": "yarn build && electron-builder --linux",
|
||||
"test": "cross-env NODE_ENV=prod node data/serve/app.js",
|
||||
"docker:build": "docker-compose -f docker/docker-compose.yml up -d --build",
|
||||
"docker:local": "docker-compose -f docker/docker-compose.local.yml up -d --build",
|
||||
"debug:ai": "npx @ai-sdk/devtools",
|
||||
"license": "bun run scripts/license.ts"
|
||||
},
|
||||
|
||||
BIN
scripts/logo.ico
|
Before Width: | Height: | Size: 172 KiB After Width: | Height: | Size: 169 KiB |
BIN
scripts/logo.png
|
Before Width: | Height: | Size: 705 KiB After Width: | Height: | Size: 71 KiB |
@ -3,20 +3,66 @@ import path from "path";
|
||||
import fs from "fs";
|
||||
import Module from "module";
|
||||
|
||||
// 加速 Electron 启动:跳过 GPU 信息收集,减少初始化耗时
|
||||
app.commandLine.appendSwitch("disable-gpu-shader-disk-cache");
|
||||
app.commandLine.appendSwitch("disable-features", "CalculateNativeWinOcclusion");
|
||||
|
||||
declare const __APP_VERSION__: string | undefined;
|
||||
|
||||
/**
|
||||
* 将 extraResources 中的 data 目录复制到用户数据目录(跳过已存在的文件,保留用户修改)
|
||||
*/
|
||||
|
||||
function getVersionFromFile(filePath: string): string | null {
|
||||
try {
|
||||
if (fs.existsSync(filePath)) {
|
||||
return fs.readFileSync(filePath, "utf8").trim();
|
||||
}
|
||||
} catch {}
|
||||
return null;
|
||||
}
|
||||
|
||||
function writeVersionToFile(filePath: string, version: string): void {
|
||||
fs.writeFileSync(filePath, version, { encoding: "utf8" });
|
||||
}
|
||||
|
||||
function copyDirForce(src: string, dest: string): void {
|
||||
if (!fs.existsSync(src)) return;
|
||||
if (fs.existsSync(dest)) {
|
||||
fs.rmSync(dest, { recursive: true, force: true });
|
||||
}
|
||||
copyDirRecursive(src, dest);
|
||||
}
|
||||
|
||||
function initializeData(): void {
|
||||
const srcDir = path.join(process.resourcesPath, "data");
|
||||
const destDir = path.join(app.getPath("userData"), "data");
|
||||
if (fs.existsSync(destDir)) return;
|
||||
const versionFile = path.join(destDir, "version.txt");
|
||||
const currentVersion = typeof __APP_VERSION__ !== "undefined" ? __APP_VERSION__ : "0.0.0";
|
||||
const userVersion = getVersionFromFile(versionFile);
|
||||
|
||||
// 首次安装或无version.txt,直接全量拷贝
|
||||
if (!fs.existsSync(destDir) || !userVersion) {
|
||||
copyDirRecursive(srcDir, destDir);
|
||||
writeVersionToFile(versionFile, currentVersion);
|
||||
return;
|
||||
}
|
||||
|
||||
// 版本号不同则覆盖 serve 和 web 目录
|
||||
if (userVersion !== currentVersion) {
|
||||
copyDirForce(path.join(srcDir, "serve"), path.join(destDir, "serve"));
|
||||
copyDirForce(path.join(srcDir, "web"), path.join(destDir, "web"));
|
||||
writeVersionToFile(versionFile, currentVersion);
|
||||
}
|
||||
}
|
||||
|
||||
function copyDirRecursive(src: string, dest: string): void {
|
||||
if (!fs.existsSync(src)) return;
|
||||
if (!fs.existsSync(dest)) fs.mkdirSync(dest, { recursive: true });
|
||||
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
|
||||
// 跳过 oss 文件夹和 db2.sqlite 文件
|
||||
if (entry.isDirectory() && entry.name === "oss") continue;
|
||||
if (!entry.isDirectory() && entry.name === "db2.sqlite") continue;
|
||||
const srcPath = path.join(src, entry.name);
|
||||
const destPath = path.join(dest, entry.name);
|
||||
if (entry.isDirectory()) {
|
||||
@ -109,7 +155,9 @@ function showLoading(): void {
|
||||
});
|
||||
loadingWindow.setMenuBarVisibility(false);
|
||||
loadingWindow.removeMenu();
|
||||
loadingWindow.on("closed", () => { loadingWindow = null; });
|
||||
loadingWindow.on("closed", () => {
|
||||
loadingWindow = null;
|
||||
});
|
||||
void loadingWindow.loadURL(loadingHtml);
|
||||
}
|
||||
|
||||
@ -120,14 +168,15 @@ function closeLoading(): void {
|
||||
}
|
||||
}
|
||||
|
||||
function createMainWindow(): void {
|
||||
function createMainWindow(): Promise<void> {
|
||||
return new Promise((resolve) => {
|
||||
const win = new BrowserWindow({
|
||||
width: 1000,
|
||||
height: 700,
|
||||
minWidth: 800,
|
||||
minHeight: 500,
|
||||
frame: false,
|
||||
show: true,
|
||||
show: false,
|
||||
autoHideMenuBar: true,
|
||||
resizable: true,
|
||||
thickFrame: true,
|
||||
@ -140,13 +189,22 @@ function createMainWindow(): void {
|
||||
mainWindow = null;
|
||||
});
|
||||
|
||||
win.once("ready-to-show", () => {
|
||||
closeLoading();
|
||||
win.show();
|
||||
resolve();
|
||||
});
|
||||
|
||||
const isDev = process.env.NODE_ENV === "dev" || !app.isPackaged;
|
||||
if (process.env.VITE_DEV) {
|
||||
void win.loadURL("http://localhost:50188");
|
||||
} else {
|
||||
const htmlPath = isDev ? path.join(process.cwd(), "data", "web", "index.html") : path.join(app.getPath("userData"), "data", "web", "index.html");
|
||||
const htmlPath = isDev
|
||||
? path.join(process.cwd(), "data", "web", "index.html")
|
||||
: path.join(app.getPath("userData"), "data", "web", "index.html");
|
||||
void win.loadFile(htmlPath);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
let closeServeFn: (() => Promise<void>) | undefined;
|
||||
@ -163,13 +221,14 @@ protocol.registerSchemesAsPrivileged([
|
||||
]);
|
||||
|
||||
app.whenReady().then(async () => {
|
||||
// 先显示加载窗口
|
||||
// 立即显示加载窗口(data URL + backgroundColor,瞬间可见)
|
||||
showLoading();
|
||||
|
||||
try {
|
||||
let servePath: string;
|
||||
if (app.isPackaged) {
|
||||
// 生产环境:从 extraResources 初始化数据到用户目录,然后从用户目录加载后端服务
|
||||
// 生产环境:让出主线程一次,确保 loading 窗口渲染后再做耗时文件拷贝
|
||||
await new Promise((r) => setTimeout(r, 0));
|
||||
initializeData();
|
||||
servePath = path.join(app.getPath("userData"), "data", "serve", "app.js");
|
||||
} else {
|
||||
@ -228,7 +287,7 @@ app.whenReady().then(async () => {
|
||||
} else {
|
||||
return { ok: false, error: "缺少url参数" };
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
const handler = handlers[pathname];
|
||||
const responseData = handler ? handler() : { error: "未知接口" };
|
||||
@ -240,13 +299,11 @@ app.whenReady().then(async () => {
|
||||
});
|
||||
});
|
||||
|
||||
// 服务启动成功,关闭加载窗口,创建主窗口
|
||||
closeLoading();
|
||||
createMainWindow();
|
||||
// 服务启动成功,创建主窗口(主窗口 ready-to-show 时自动关闭loading)
|
||||
await createMainWindow();
|
||||
} catch (err) {
|
||||
console.error("[服务启动失败]:", err);
|
||||
closeLoading();
|
||||
createMainWindow();
|
||||
await createMainWindow();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
14
src/app.ts
@ -29,16 +29,24 @@ export default async function startServe(randomPort: Boolean = false) {
|
||||
app.use(express.json({ limit: "100mb" }));
|
||||
app.use(express.urlencoded({ extended: true, limit: "100mb" }));
|
||||
|
||||
const rootDir = u.getPath("oss");
|
||||
|
||||
// 确保 uploads 目录存在
|
||||
// oss 静态资源
|
||||
const rootDir = u.getPath("oss");
|
||||
if (!fs.existsSync(rootDir)) {
|
||||
fs.mkdirSync(rootDir, { recursive: true });
|
||||
}
|
||||
console.log("文件目录:", rootDir);
|
||||
|
||||
app.use(express.static(rootDir));
|
||||
|
||||
// data/web 静态网站
|
||||
const webDir = u.getPath("web");
|
||||
if (fs.existsSync(webDir)) {
|
||||
console.log("静态网站目录:", webDir);
|
||||
app.use(express.static(webDir));
|
||||
} else {
|
||||
console.warn("静态网站目录不存在:", webDir);
|
||||
}
|
||||
|
||||
app.use(async (req, res, next) => {
|
||||
const setting = await u.db("o_setting").where("key", "tokenKey").select("value").first();
|
||||
if (!setting) return res.status(444).send({ message: "服务器秘钥未配置,请联系管理员" });
|
||||
|
||||
262
src/router.ts
@ -1,4 +1,4 @@
|
||||
// @routes-hash fc02af7340ae26f567792eda4cde50a6
|
||||
// @routes-hash 01a3e214a845cf74065af521bc0794cc
|
||||
import { Express } from "express";
|
||||
|
||||
import route1 from "./routes/agents/clearMemory";
|
||||
@ -57,69 +57,73 @@ import route53 from "./routes/production/getFlowData";
|
||||
import route54 from "./routes/production/getProductionData";
|
||||
import route55 from "./routes/production/getStoryboardData";
|
||||
import route56 from "./routes/production/saveFlowData";
|
||||
import route57 from "./routes/production/storyboard/batchGenerateImage";
|
||||
import route58 from "./routes/production/storyboard/downPreviewImage";
|
||||
import route59 from "./routes/production/storyboard/getStoryboardData";
|
||||
import route60 from "./routes/production/storyboard/pollingImage";
|
||||
import route61 from "./routes/production/storyboard/previewImage";
|
||||
import route62 from "./routes/production/workbench/confirmSelection";
|
||||
import route63 from "./routes/production/workbench/delVideo";
|
||||
import route64 from "./routes/production/workbench/generateVideo";
|
||||
import route65 from "./routes/production/workbench/generateVideoPrompt";
|
||||
import route66 from "./routes/production/workbench/getChatLines";
|
||||
import route67 from "./routes/production/workbench/getVideoModelDetail";
|
||||
import route68 from "./routes/production/workbench/videoPolling";
|
||||
import route69 from "./routes/project/addProject";
|
||||
import route70 from "./routes/project/addVisual";
|
||||
import route71 from "./routes/project/addVisualManual";
|
||||
import route72 from "./routes/project/deleteVisualManual";
|
||||
import route73 from "./routes/project/delProject";
|
||||
import route74 from "./routes/project/editProject";
|
||||
import route75 from "./routes/project/editVisualManual";
|
||||
import route76 from "./routes/project/getProject";
|
||||
import route77 from "./routes/project/getVisualManual";
|
||||
import route78 from "./routes/project/visualManual";
|
||||
import route79 from "./routes/script/addScript";
|
||||
import route80 from "./routes/script/delScript";
|
||||
import route81 from "./routes/script/exportScript";
|
||||
import route82 from "./routes/script/extractAssets";
|
||||
import route83 from "./routes/script/getScrptApi";
|
||||
import route84 from "./routes/script/pollScriptAssets";
|
||||
import route85 from "./routes/script/updateScript";
|
||||
import route86 from "./routes/scriptAgent/getPlanData";
|
||||
import route87 from "./routes/scriptAgent/setPlanData";
|
||||
import route88 from "./routes/scriptAgent/updateData";
|
||||
import route89 from "./routes/setting/about/checkUpdate";
|
||||
import route90 from "./routes/setting/about/downloadApp";
|
||||
import route91 from "./routes/setting/agentDeploy/agentSetKey";
|
||||
import route92 from "./routes/setting/agentDeploy/deployAgentModel";
|
||||
import route93 from "./routes/setting/agentDeploy/getAgentDeploy";
|
||||
import route94 from "./routes/setting/dbConfig/clearData";
|
||||
import route95 from "./routes/setting/dev/getSwitchAiDevTool";
|
||||
import route96 from "./routes/setting/dev/updateSwitchAiDevTool";
|
||||
import route97 from "./routes/setting/fileManagement/openFolder";
|
||||
import route98 from "./routes/setting/getTextModel";
|
||||
import route99 from "./routes/setting/loginConfig/getUser";
|
||||
import route100 from "./routes/setting/loginConfig/updateUserPwd";
|
||||
import route101 from "./routes/setting/memoryConfig/delAllMemory";
|
||||
import route102 from "./routes/setting/memoryConfig/getMemory";
|
||||
import route103 from "./routes/setting/memoryConfig/sureMemory";
|
||||
import route104 from "./routes/setting/promptManage/getPrompt";
|
||||
import route105 from "./routes/setting/promptManage/updatePrompt";
|
||||
import route106 from "./routes/setting/skillManagement/getSkillContent";
|
||||
import route107 from "./routes/setting/skillManagement/getSkillList";
|
||||
import route108 from "./routes/setting/skillManagement/saveSkillContent";
|
||||
import route109 from "./routes/setting/vendorConfig/addVendor";
|
||||
import route110 from "./routes/setting/vendorConfig/deleteVendor";
|
||||
import route111 from "./routes/setting/vendorConfig/getVendorList";
|
||||
import route112 from "./routes/setting/vendorConfig/modelTest";
|
||||
import route113 from "./routes/setting/vendorConfig/updateCode";
|
||||
import route114 from "./routes/setting/vendorConfig/updateVendor";
|
||||
import route115 from "./routes/task/getProject";
|
||||
import route116 from "./routes/task/getTaskApi";
|
||||
import route117 from "./routes/task/getTaskCategories";
|
||||
import route118 from "./routes/task/taskDetails";
|
||||
import route119 from "./routes/test/test";
|
||||
import route57 from "./routes/production/storyboard/batchAddStoryboardInfo";
|
||||
import route58 from "./routes/production/storyboard/batchGenerateImage";
|
||||
import route59 from "./routes/production/storyboard/downPreviewImage";
|
||||
import route60 from "./routes/production/storyboard/editStoryboardInfo";
|
||||
import route61 from "./routes/production/storyboard/getStoryboardData";
|
||||
import route62 from "./routes/production/storyboard/pollingImage";
|
||||
import route63 from "./routes/production/storyboard/previewImage";
|
||||
import route64 from "./routes/production/storyboard/removeFrame";
|
||||
import route65 from "./routes/production/storyboard/updateStoryboardInfo";
|
||||
import route66 from "./routes/production/workbench/confirmSelection";
|
||||
import route67 from "./routes/production/workbench/delVideo";
|
||||
import route68 from "./routes/production/workbench/generateVideo";
|
||||
import route69 from "./routes/production/workbench/generateVideoPrompt";
|
||||
import route70 from "./routes/production/workbench/getChatLines";
|
||||
import route71 from "./routes/production/workbench/getVideoModelDetail";
|
||||
import route72 from "./routes/production/workbench/videoPolling";
|
||||
import route73 from "./routes/project/addProject";
|
||||
import route74 from "./routes/project/addVisual";
|
||||
import route75 from "./routes/project/addVisualManual";
|
||||
import route76 from "./routes/project/deleteVisualManual";
|
||||
import route77 from "./routes/project/delProject";
|
||||
import route78 from "./routes/project/editProject";
|
||||
import route79 from "./routes/project/editVisualManual";
|
||||
import route80 from "./routes/project/getProject";
|
||||
import route81 from "./routes/project/getVisualManual";
|
||||
import route82 from "./routes/project/visualManual";
|
||||
import route83 from "./routes/script/addScript";
|
||||
import route84 from "./routes/script/delScript";
|
||||
import route85 from "./routes/script/exportScript";
|
||||
import route86 from "./routes/script/extractAssets";
|
||||
import route87 from "./routes/script/getScrptApi";
|
||||
import route88 from "./routes/script/pollScriptAssets";
|
||||
import route89 from "./routes/script/updateScript";
|
||||
import route90 from "./routes/scriptAgent/getPlanData";
|
||||
import route91 from "./routes/scriptAgent/setPlanData";
|
||||
import route92 from "./routes/scriptAgent/updateData";
|
||||
import route93 from "./routes/setting/about/checkUpdate";
|
||||
import route94 from "./routes/setting/about/downloadApp";
|
||||
import route95 from "./routes/setting/agentDeploy/agentSetKey";
|
||||
import route96 from "./routes/setting/agentDeploy/deployAgentModel";
|
||||
import route97 from "./routes/setting/agentDeploy/getAgentDeploy";
|
||||
import route98 from "./routes/setting/dbConfig/clearData";
|
||||
import route99 from "./routes/setting/dev/getSwitchAiDevTool";
|
||||
import route100 from "./routes/setting/dev/updateSwitchAiDevTool";
|
||||
import route101 from "./routes/setting/fileManagement/openFolder";
|
||||
import route102 from "./routes/setting/getTextModel";
|
||||
import route103 from "./routes/setting/loginConfig/getUser";
|
||||
import route104 from "./routes/setting/loginConfig/updateUserPwd";
|
||||
import route105 from "./routes/setting/memoryConfig/delAllMemory";
|
||||
import route106 from "./routes/setting/memoryConfig/getMemory";
|
||||
import route107 from "./routes/setting/memoryConfig/sureMemory";
|
||||
import route108 from "./routes/setting/promptManage/getPrompt";
|
||||
import route109 from "./routes/setting/promptManage/updatePrompt";
|
||||
import route110 from "./routes/setting/skillManagement/getSkillContent";
|
||||
import route111 from "./routes/setting/skillManagement/getSkillList";
|
||||
import route112 from "./routes/setting/skillManagement/saveSkillContent";
|
||||
import route113 from "./routes/setting/vendorConfig/addVendor";
|
||||
import route114 from "./routes/setting/vendorConfig/deleteVendor";
|
||||
import route115 from "./routes/setting/vendorConfig/getVendorList";
|
||||
import route116 from "./routes/setting/vendorConfig/modelTest";
|
||||
import route117 from "./routes/setting/vendorConfig/updateCode";
|
||||
import route118 from "./routes/setting/vendorConfig/updateVendor";
|
||||
import route119 from "./routes/task/getProject";
|
||||
import route120 from "./routes/task/getTaskApi";
|
||||
import route121 from "./routes/task/getTaskCategories";
|
||||
import route122 from "./routes/task/taskDetails";
|
||||
import route123 from "./routes/test/test";
|
||||
|
||||
export default async (app: Express) => {
|
||||
app.use("/api/agents/clearMemory", route1);
|
||||
@ -178,67 +182,71 @@ export default async (app: Express) => {
|
||||
app.use("/api/production/getProductionData", route54);
|
||||
app.use("/api/production/getStoryboardData", route55);
|
||||
app.use("/api/production/saveFlowData", route56);
|
||||
app.use("/api/production/storyboard/batchGenerateImage", route57);
|
||||
app.use("/api/production/storyboard/downPreviewImage", route58);
|
||||
app.use("/api/production/storyboard/getStoryboardData", route59);
|
||||
app.use("/api/production/storyboard/pollingImage", route60);
|
||||
app.use("/api/production/storyboard/previewImage", route61);
|
||||
app.use("/api/production/workbench/confirmSelection", route62);
|
||||
app.use("/api/production/workbench/delVideo", route63);
|
||||
app.use("/api/production/workbench/generateVideo", route64);
|
||||
app.use("/api/production/workbench/generateVideoPrompt", route65);
|
||||
app.use("/api/production/workbench/getChatLines", route66);
|
||||
app.use("/api/production/workbench/getVideoModelDetail", route67);
|
||||
app.use("/api/production/workbench/videoPolling", route68);
|
||||
app.use("/api/project/addProject", route69);
|
||||
app.use("/api/project/addVisual", route70);
|
||||
app.use("/api/project/addVisualManual", route71);
|
||||
app.use("/api/project/deleteVisualManual", route72);
|
||||
app.use("/api/project/delProject", route73);
|
||||
app.use("/api/project/editProject", route74);
|
||||
app.use("/api/project/editVisualManual", route75);
|
||||
app.use("/api/project/getProject", route76);
|
||||
app.use("/api/project/getVisualManual", route77);
|
||||
app.use("/api/project/visualManual", route78);
|
||||
app.use("/api/script/addScript", route79);
|
||||
app.use("/api/script/delScript", route80);
|
||||
app.use("/api/script/exportScript", route81);
|
||||
app.use("/api/script/extractAssets", route82);
|
||||
app.use("/api/script/getScrptApi", route83);
|
||||
app.use("/api/script/pollScriptAssets", route84);
|
||||
app.use("/api/script/updateScript", route85);
|
||||
app.use("/api/scriptAgent/getPlanData", route86);
|
||||
app.use("/api/scriptAgent/setPlanData", route87);
|
||||
app.use("/api/scriptAgent/updateData", route88);
|
||||
app.use("/api/setting/about/checkUpdate", route89);
|
||||
app.use("/api/setting/about/downloadApp", route90);
|
||||
app.use("/api/setting/agentDeploy/agentSetKey", route91);
|
||||
app.use("/api/setting/agentDeploy/deployAgentModel", route92);
|
||||
app.use("/api/setting/agentDeploy/getAgentDeploy", route93);
|
||||
app.use("/api/setting/dbConfig/clearData", route94);
|
||||
app.use("/api/setting/dev/getSwitchAiDevTool", route95);
|
||||
app.use("/api/setting/dev/updateSwitchAiDevTool", route96);
|
||||
app.use("/api/setting/fileManagement/openFolder", route97);
|
||||
app.use("/api/setting/getTextModel", route98);
|
||||
app.use("/api/setting/loginConfig/getUser", route99);
|
||||
app.use("/api/setting/loginConfig/updateUserPwd", route100);
|
||||
app.use("/api/setting/memoryConfig/delAllMemory", route101);
|
||||
app.use("/api/setting/memoryConfig/getMemory", route102);
|
||||
app.use("/api/setting/memoryConfig/sureMemory", route103);
|
||||
app.use("/api/setting/promptManage/getPrompt", route104);
|
||||
app.use("/api/setting/promptManage/updatePrompt", route105);
|
||||
app.use("/api/setting/skillManagement/getSkillContent", route106);
|
||||
app.use("/api/setting/skillManagement/getSkillList", route107);
|
||||
app.use("/api/setting/skillManagement/saveSkillContent", route108);
|
||||
app.use("/api/setting/vendorConfig/addVendor", route109);
|
||||
app.use("/api/setting/vendorConfig/deleteVendor", route110);
|
||||
app.use("/api/setting/vendorConfig/getVendorList", route111);
|
||||
app.use("/api/setting/vendorConfig/modelTest", route112);
|
||||
app.use("/api/setting/vendorConfig/updateCode", route113);
|
||||
app.use("/api/setting/vendorConfig/updateVendor", route114);
|
||||
app.use("/api/task/getProject", route115);
|
||||
app.use("/api/task/getTaskApi", route116);
|
||||
app.use("/api/task/getTaskCategories", route117);
|
||||
app.use("/api/task/taskDetails", route118);
|
||||
app.use("/api/test/test", route119);
|
||||
app.use("/api/production/storyboard/batchAddStoryboardInfo", route57);
|
||||
app.use("/api/production/storyboard/batchGenerateImage", route58);
|
||||
app.use("/api/production/storyboard/downPreviewImage", route59);
|
||||
app.use("/api/production/storyboard/editStoryboardInfo", route60);
|
||||
app.use("/api/production/storyboard/getStoryboardData", route61);
|
||||
app.use("/api/production/storyboard/pollingImage", route62);
|
||||
app.use("/api/production/storyboard/previewImage", route63);
|
||||
app.use("/api/production/storyboard/removeFrame", route64);
|
||||
app.use("/api/production/storyboard/updateStoryboardInfo", route65);
|
||||
app.use("/api/production/workbench/confirmSelection", route66);
|
||||
app.use("/api/production/workbench/delVideo", route67);
|
||||
app.use("/api/production/workbench/generateVideo", route68);
|
||||
app.use("/api/production/workbench/generateVideoPrompt", route69);
|
||||
app.use("/api/production/workbench/getChatLines", route70);
|
||||
app.use("/api/production/workbench/getVideoModelDetail", route71);
|
||||
app.use("/api/production/workbench/videoPolling", route72);
|
||||
app.use("/api/project/addProject", route73);
|
||||
app.use("/api/project/addVisual", route74);
|
||||
app.use("/api/project/addVisualManual", route75);
|
||||
app.use("/api/project/deleteVisualManual", route76);
|
||||
app.use("/api/project/delProject", route77);
|
||||
app.use("/api/project/editProject", route78);
|
||||
app.use("/api/project/editVisualManual", route79);
|
||||
app.use("/api/project/getProject", route80);
|
||||
app.use("/api/project/getVisualManual", route81);
|
||||
app.use("/api/project/visualManual", route82);
|
||||
app.use("/api/script/addScript", route83);
|
||||
app.use("/api/script/delScript", route84);
|
||||
app.use("/api/script/exportScript", route85);
|
||||
app.use("/api/script/extractAssets", route86);
|
||||
app.use("/api/script/getScrptApi", route87);
|
||||
app.use("/api/script/pollScriptAssets", route88);
|
||||
app.use("/api/script/updateScript", route89);
|
||||
app.use("/api/scriptAgent/getPlanData", route90);
|
||||
app.use("/api/scriptAgent/setPlanData", route91);
|
||||
app.use("/api/scriptAgent/updateData", route92);
|
||||
app.use("/api/setting/about/checkUpdate", route93);
|
||||
app.use("/api/setting/about/downloadApp", route94);
|
||||
app.use("/api/setting/agentDeploy/agentSetKey", route95);
|
||||
app.use("/api/setting/agentDeploy/deployAgentModel", route96);
|
||||
app.use("/api/setting/agentDeploy/getAgentDeploy", route97);
|
||||
app.use("/api/setting/dbConfig/clearData", route98);
|
||||
app.use("/api/setting/dev/getSwitchAiDevTool", route99);
|
||||
app.use("/api/setting/dev/updateSwitchAiDevTool", route100);
|
||||
app.use("/api/setting/fileManagement/openFolder", route101);
|
||||
app.use("/api/setting/getTextModel", route102);
|
||||
app.use("/api/setting/loginConfig/getUser", route103);
|
||||
app.use("/api/setting/loginConfig/updateUserPwd", route104);
|
||||
app.use("/api/setting/memoryConfig/delAllMemory", route105);
|
||||
app.use("/api/setting/memoryConfig/getMemory", route106);
|
||||
app.use("/api/setting/memoryConfig/sureMemory", route107);
|
||||
app.use("/api/setting/promptManage/getPrompt", route108);
|
||||
app.use("/api/setting/promptManage/updatePrompt", route109);
|
||||
app.use("/api/setting/skillManagement/getSkillContent", route110);
|
||||
app.use("/api/setting/skillManagement/getSkillList", route111);
|
||||
app.use("/api/setting/skillManagement/saveSkillContent", route112);
|
||||
app.use("/api/setting/vendorConfig/addVendor", route113);
|
||||
app.use("/api/setting/vendorConfig/deleteVendor", route114);
|
||||
app.use("/api/setting/vendorConfig/getVendorList", route115);
|
||||
app.use("/api/setting/vendorConfig/modelTest", route116);
|
||||
app.use("/api/setting/vendorConfig/updateCode", route117);
|
||||
app.use("/api/setting/vendorConfig/updateVendor", route118);
|
||||
app.use("/api/task/getProject", route119);
|
||||
app.use("/api/task/getTaskApi", route120);
|
||||
app.use("/api/task/getTaskCategories", route121);
|
||||
app.use("/api/task/taskDetails", route122);
|
||||
app.use("/api/test/test", route123);
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ export default router.post(
|
||||
.andWhere("o_assets.type", "<>", "clip")
|
||||
.modify((qb) => {
|
||||
if (type && type.length > 0) qb.whereIn("o_assets.type", type);
|
||||
});
|
||||
}).orderByRaw(`CASE o_assets.type WHEN 'role' THEN 1 WHEN 'scene' THEN 2 WHEN 'tool' THEN 3 ELSE 4 END`);
|
||||
const result = await Promise.all(
|
||||
data.map(async (parent: any) => {
|
||||
const historyImages = await u.db("o_image").where("assetsId", parent.id).andWhere("state", "已完成").select("id", "filePath");
|
||||
|
||||
@ -51,12 +51,14 @@ export default router.post(
|
||||
tool: {
|
||||
prompt: toolPrompt,
|
||||
label: "道具衍生资产",
|
||||
focus: "注重道具的材质质感、光影效果、结构细节与功能特征,保持与原始道具设计的一致性(如形状、配色、标志性元素),清晰展示道具在不同状态或角度下的视觉表现。",
|
||||
focus:
|
||||
"注重道具的材质质感、光影效果、结构细节与功能特征,保持与原始道具设计的一致性(如形状、配色、标志性元素),清晰展示道具在不同状态或角度下的视觉表现。",
|
||||
},
|
||||
scene: {
|
||||
prompt: scenePrompt,
|
||||
label: "场景衍生资产",
|
||||
focus: "注重场景的空间层次、光影氛围、环境细节与情绪渲染,保持与原始场景设计的一致性(如建筑风格、色调、标志性地标),体现不同时间段或天气条件下的视觉变化。",
|
||||
focus:
|
||||
"注重场景的空间层次、光影氛围、环境细节与情绪渲染,保持与原始场景设计的一致性(如建筑风格、色调、标志性地标),体现不同时间段或天气条件下的视觉变化。",
|
||||
},
|
||||
};
|
||||
const imageData = [];
|
||||
@ -72,7 +74,6 @@ export default router.post(
|
||||
|
||||
## 输出要求
|
||||
- 直接输出最终提示词,不要包含任何解释、标题或标记
|
||||
- 提示词应为具体的视觉描述,包含主体、构图、光影、色调、氛围等要素
|
||||
- ${typeConfig.focus}
|
||||
${hasRefImage ? "- 当前资产有参考图作为风格锚点,提示词应侧重描述衍生变化部分,避免重复参考图已有的基础特征" : "- 当前资产无参考图,提示词需要完整描述视觉特征"}
|
||||
|
||||
@ -86,11 +87,6 @@ ${typeConfig.prompt || "(未指定特定美术风格,请根据资产描述
|
||||
],
|
||||
});
|
||||
|
||||
const repeloadObj = {
|
||||
prompt: text,
|
||||
size: projectSettingData?.imageQuality as "1K" | "2K" | "4K",
|
||||
aspectRatio: "16:9",
|
||||
};
|
||||
const [imageId] = await u.db("o_image").insert({
|
||||
assetsId: item.id,
|
||||
type: item.type,
|
||||
@ -100,16 +96,23 @@ ${typeConfig.prompt || "(未指定特定美术风格,请根据资产描述
|
||||
});
|
||||
const imageBase64 = imageUrlRecord[item.assetsId!] ? await urlToBase64(imageUrlRecord[item.assetsId!]) : null;
|
||||
try {
|
||||
const imageCls = await u.Ai.Image(projectSettingData?.imageModel as `${string}:${string}`).run({
|
||||
const repeloadObj = {
|
||||
prompt: text,
|
||||
imageBase64: imageBase64 ? [imageBase64] : [],
|
||||
size: projectSettingData?.imageQuality as "1K" | "2K" | "4K",
|
||||
aspectRatio: "16:9",
|
||||
aspectRatio: "16:9" as `${number}:${number}`,
|
||||
};
|
||||
const imageCls = await u.Ai.Image(projectSettingData?.imageModel as `${string}:${string}`).run(
|
||||
{
|
||||
imageBase64: imageBase64 ? [imageBase64] : [],
|
||||
...repeloadObj,
|
||||
},
|
||||
{
|
||||
taskClass: "生成图片",
|
||||
describe: "资产图片生成",
|
||||
relatedObjects: JSON.stringify(repeloadObj),
|
||||
projectId: projectId,
|
||||
});
|
||||
},
|
||||
);
|
||||
const savePath = `/${projectId}/assets/${scriptId}/${u.uuid()}.jpg`;
|
||||
await imageCls.save(savePath);
|
||||
// 更新对应数据库
|
||||
@ -121,7 +124,6 @@ ${typeConfig.prompt || "(未指定特定美术风格,请根据资产描述
|
||||
src: await u.oss.getFileUrl(savePath),
|
||||
});
|
||||
} catch (e) {
|
||||
console.log("%c Line:95 🥛 e", "background:#fca650", e);
|
||||
await u
|
||||
.db("o_image")
|
||||
.where({ id: imageId })
|
||||
|
||||
@ -24,17 +24,17 @@ export default router.post(
|
||||
episodesId: number;
|
||||
} = req.body;
|
||||
const sqlData = await u.db("o_agentWorkData").where("projectId", String(projectId)).andWhere("episodesId", String(episodesId)).first();
|
||||
if (data.storyboard && data.storyboard.length)
|
||||
await Promise.all(
|
||||
data.storyboard.map(async (i, index) => {
|
||||
await u
|
||||
.db("o_storyboard")
|
||||
.where("id", i.id)
|
||||
.update({
|
||||
index: index + 1,
|
||||
});
|
||||
}),
|
||||
);
|
||||
// if (data.storyboard && data.storyboard.length)
|
||||
// await Promise.all(
|
||||
// data.storyboard.map(async (i, index) => {
|
||||
// await u
|
||||
// .db("o_storyboard")
|
||||
// .where("id", i.id)
|
||||
// .update({
|
||||
// index: index + 1,
|
||||
// });
|
||||
// }),
|
||||
// );
|
||||
if (!sqlData) {
|
||||
await u.db("o_agentWorkData").insert({
|
||||
projectId,
|
||||
|
||||
31
src/routes/production/storyboard/batchAddStoryboardInfo.ts
Normal file
@ -0,0 +1,31 @@
|
||||
import express from "express";
|
||||
import u from "@/utils";
|
||||
import { z } from "zod";
|
||||
import { success } from "@/lib/responseFormat";
|
||||
import { validateFields } from "@/middleware/middleware";
|
||||
const router = express.Router();
|
||||
|
||||
export default router.post(
|
||||
"/",
|
||||
validateFields({
|
||||
data: z.array(
|
||||
z.object({
|
||||
prompt: z.string(),
|
||||
}),
|
||||
),
|
||||
scriptId: z.number(),
|
||||
}),
|
||||
async (req, res) => {
|
||||
const { data, scriptId } = req.body;
|
||||
if (!data.length) return res.status(400).send({ success: false, message: "数据不能为空" });
|
||||
await u.db("o_storyboard").insert(
|
||||
data.map((i: { prompt: string }) => ({
|
||||
...i,
|
||||
scriptId,
|
||||
createTime: Date.now(),
|
||||
state: "未生成",
|
||||
})),
|
||||
);
|
||||
return res.status(200).send(success());
|
||||
},
|
||||
);
|
||||
@ -169,23 +169,25 @@ ${sceneArkPrompt || "(未指定特定美术风格,请根据分镜内容选
|
||||
const repeloadObj = {
|
||||
prompt: text,
|
||||
size: projectSettingData?.imageQuality as "1K" | "2K" | "4K",
|
||||
aspectRatio: "16:9",
|
||||
aspectRatio: "16:9" as `${number}:${number}`,
|
||||
};
|
||||
await u.db("o_storyboard").where("id", item.id).update({
|
||||
prompt: text,
|
||||
state: "生成中",
|
||||
});
|
||||
u.Ai.Image(projectSettingData?.imageModel as `${string}:${string}`)
|
||||
.run({
|
||||
prompt: text,
|
||||
.run(
|
||||
{
|
||||
imageBase64: await getAssetsImageBase64(assetRecord[item.id!] || []),
|
||||
size: projectSettingData?.imageQuality as "1K" | "2K" | "4K",
|
||||
aspectRatio: "16:9",
|
||||
taskClass: "生成图片",
|
||||
describe: "资产图片生成",
|
||||
...repeloadObj,
|
||||
},
|
||||
{
|
||||
taskClass: "生成分镜图片",
|
||||
describe: "分镜图片生成",
|
||||
relatedObjects: JSON.stringify(repeloadObj),
|
||||
projectId: projectId,
|
||||
})
|
||||
},
|
||||
)
|
||||
.then(async (imageCls) => {
|
||||
const savePath = `/${projectId}/assets/${scriptId}/${u.uuid()}.jpg`;
|
||||
await imageCls.save(savePath);
|
||||
|
||||
22
src/routes/production/storyboard/editStoryboardInfo.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import express from "express";
|
||||
import u from "@/utils";
|
||||
import { z } from "zod";
|
||||
import { success } from "@/lib/responseFormat";
|
||||
import { validateFields } from "@/middleware/middleware";
|
||||
import { id } from "zod/locales";
|
||||
const router = express.Router();
|
||||
|
||||
export default router.post(
|
||||
"/",
|
||||
validateFields({
|
||||
id: z.number(),
|
||||
prompt: z.string(),
|
||||
}),
|
||||
async (req, res) => {
|
||||
const { id, prompt } = req.body;
|
||||
await u.db("o_storyboard").where({ id }).update({
|
||||
prompt,
|
||||
});
|
||||
res.status(200).send(success({ message: "更新提示词成功" }));
|
||||
},
|
||||
);
|
||||
19
src/routes/production/storyboard/removeFrame.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import express from "express";
|
||||
import u from "@/utils";
|
||||
import { z } from "zod";
|
||||
import { success } from "@/lib/responseFormat";
|
||||
import { validateFields } from "@/middleware/middleware";
|
||||
const router = express.Router();
|
||||
|
||||
export default router.post(
|
||||
"/",
|
||||
validateFields({
|
||||
id: z.number(),
|
||||
}),
|
||||
async (req, res) => {
|
||||
const { id } = req.body;
|
||||
await u.db("o_storyboard").where("id", id).delete();
|
||||
await u.db("o_assets2Storyboard").where("storyboardId", id).delete();
|
||||
res.status(200).send(success({ message: "视频删除成功" }));
|
||||
},
|
||||
);
|
||||
22
src/routes/production/storyboard/updateStoryboardInfo.ts
Normal file
@ -0,0 +1,22 @@
|
||||
import express from "express";
|
||||
import u from "@/utils";
|
||||
import { z } from "zod";
|
||||
import { success } from "@/lib/responseFormat";
|
||||
import { validateFields } from "@/middleware/middleware";
|
||||
import { id } from "zod/locales";
|
||||
const router = express.Router();
|
||||
|
||||
export default router.post(
|
||||
"/",
|
||||
validateFields({
|
||||
id: z.number(),
|
||||
prompt: z.string(),
|
||||
}),
|
||||
async (req, res) => {
|
||||
const { id, prompt } = req.body;
|
||||
await u.db("o_storyboard").where({ id }).update({
|
||||
prompt,
|
||||
});
|
||||
res.status(200).send(success({ message: "更新提示词成功" }));
|
||||
},
|
||||
);
|
||||
4
src/types/database.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
// @db-hash 6be0a80e9c8f541987a4c1e907736237
|
||||
// @db-hash 93b2462070c45c2b449e9a18c4e88763
|
||||
//该文件由脚本自动生成,请勿手动修改
|
||||
|
||||
export interface memories {
|
||||
@ -178,7 +178,6 @@ export interface o_storyboard {
|
||||
'sound'?: string | null;
|
||||
'state'?: string | null;
|
||||
'title'?: string | null;
|
||||
'videoPrompt'?: string | null;
|
||||
}
|
||||
export interface o_tasks {
|
||||
'describe'?: string | null;
|
||||
@ -212,7 +211,6 @@ export interface o_video {
|
||||
'errorReason'?: string | null;
|
||||
'filePath'?: string | null;
|
||||
'id'?: number;
|
||||
'projectId'?: number | null;
|
||||
'scriptId'?: number | null;
|
||||
'state'?: string | null;
|
||||
'storyboardId'?: number | null;
|
||||
|
||||