-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Docs for text2image flux and image2image #15574
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lukasdotcom
wants to merge
2
commits into
master
Choose a base branch
from
docs/text2image-flux
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| =================================================== | ||
| App: Local Image Generation: Flux (text2image_flux) | ||
| =================================================== | ||
|
|
||
| .. _ai-app-text2image_flux: | ||
|
|
||
| The *text2image_flux* app is one of the apps that provide image generation functionality in Nextcloud and act as an | ||
| image generation backend for the :ref:`Nextcloud Assistant app<ai-app-assistant>` and :ref:`other apps making use of | ||
| the image generation functionality<t2i-consumer-apps>`. It also provides image editing (image-to-image) from a text | ||
| prompt. The *text2image_flux* app specifically runs only open source models and does so entirely on-premises. | ||
| Nextcloud can provide customer support upon request, please talk to your account manager for the possibilities. | ||
|
|
||
| Providers | ||
| --------- | ||
|
|
||
| The app registers the following Task Processing providers: | ||
|
|
||
| * **Nextcloud Local Image Generation: Flux 2 Klein 4B** - text-to-image (``core:text2image``) | ||
| * **Nextcloud Local Image Generation: Flux 2 Klein 4B (Enhanced)** - text-to-image with automatic prompt refinement | ||
| via a text-to-text provider (``core:text2text``) before generation | ||
| * **Nextcloud Local Image Editing: Flux 2 Klein 4B** - image editing from a prompt (``core:image2image`` on | ||
| Nextcloud 36+; a custom ``text2image_flux:image2image`` task type on Nextcloud 35 and older) | ||
|
|
||
| Select the providers in the Nextcloud AI admin settings. For the Enhanced provider, also install and enable a | ||
| text-to-text backend such as :ref:`llm2<ai-app-llm2>`. | ||
|
|
||
| Default output size is ``1024x1024``. You can override the size per task (``WxH`` format) or change the default via the | ||
| ``DEFAULT_SIZE`` deploy option (see :ref:`Configuration <ai-app-text2image_flux-configuration>` below). | ||
|
|
||
| Requirements | ||
| ------------ | ||
|
|
||
| * Minimal Nextcloud version: 30 | ||
| * This app is built as an External App and thus depends on AppAPI v3.1.0 or higher | ||
| * Nextcloud AIO is supported | ||
| * We currently support NVIDIA GPUs and x86_64 CPUs | ||
| * CUDA >= v12.2 on your host system | ||
| * GPU Sizing | ||
|
|
||
| * A NVIDIA GPU with at least 8GB VRAM (roughly 7GB used) | ||
| * At least 8GB of system RAM | ||
|
|
||
| * CPU Sizing | ||
|
|
||
| * CPU inference is supported but very slow; for faster generation prefer a GPU or use | ||
| :ref:`text2image_stablediffusion2<ai-app-text2image_stablediffusion2>` | ||
| * At least 12GB of system RAM | ||
| * The more cores you have and the more powerful the CPU the better, we recommend 10-20 cores | ||
| * The app will hog all cores by default, so it is usually better to run it on a separate machine | ||
|
|
||
| Installation | ||
| ------------ | ||
|
|
||
| 0. Make sure the :ref:`Nextcloud Assistant app<ai-app-assistant>` is installed | ||
| 1. :ref:`Install AppAPI and setup a Deploy Demon<ai-app_api>` | ||
| 2. Install the **Local Image Generation: Flux** ExApp via the "Apps" page in the Nextcloud web admin user interface | ||
| 3. Optionally install a text-to-text provider such as :ref:`llm2<ai-app-llm2>` if you want to use the Enhanced | ||
| text-to-image provider | ||
| 4. Select the Flux providers in the Nextcloud AI admin settings | ||
|
|
||
| .. _ai-app-text2image_flux-configuration: | ||
|
|
||
| Configuration | ||
| ------------- | ||
|
|
||
| You can set the following environment variables in the :ref:`Deploy Options <ai-app_api_deploy_options>` when installing | ||
| or redeploying the ExApp: | ||
|
|
||
| * ``NUM_INFERENCE_STEPS`` - Number of denoising steps used when generating or editing images. Default is ``4``. | ||
| * ``DEFAULT_SIZE`` - Default size of generated or edited images in ``WxH`` format (for example ``1024x1024``). Used when | ||
| no size is provided with the task. Default is ``1024x1024``. | ||
|
|
||
| Scaling | ||
| ------- | ||
|
|
||
| It is currently not possible to scale this app, we are working on this. Throughput is lower than with | ||
| :ref:`text2image_stablediffusion2<ai-app-text2image_stablediffusion2>` because Flux generation is slower. We do | ||
| appreciate real-world feedback on capacity. | ||
|
|
||
| App store | ||
| --------- | ||
|
|
||
| You can also find the app in our app store, where you can write a review: | ||
| `<https://apps.nextcloud.com/apps/text2image_flux>`_ | ||
|
|
||
| Repository | ||
| ---------- | ||
|
|
||
| You can find the app's code repository on GitHub where you can report bugs and contribute fixes and features: | ||
| `<https://github.com/nextcloud/text2image_flux>`_ | ||
|
|
||
| Nextcloud customers should file bugs directly with our Support system. | ||
|
|
||
| Ethical AI Rating | ||
| ----------------- | ||
|
|
||
| **Rating: Yellow** | ||
|
|
||
| Positive: | ||
|
|
||
| * The software for training and inferencing of this model is open source | ||
| * The trained model is freely available under Apache 2.0, and thus can be run on-premises | ||
|
|
||
| Negative: | ||
|
|
||
| * The training data is not freely available, making it not possible to check or correct for bias or optimise the | ||
| performance and CO2 usage | ||
|
|
||
| Learn more about the Nextcloud Ethical AI Rating | ||
| `in our blog <https://nextcloud.com/blog/nextcloud-ethical-ai-rating/>`_. | ||
|
|
||
| Known Limitations | ||
| ----------------- | ||
|
|
||
| * Image generation and editing are slower than with | ||
| :ref:`text2image_stablediffusion2<ai-app-text2image_stablediffusion2>`; prefer that app if speed matters more than quality | ||
| * The Enhanced provider depends on a working text-to-text Task Processing provider; if prompt improvement fails, the original prompt is used | ||
| * Faces and people in general may not be generated properly | ||
| * The results for certain image generation requests can be biased and may enforce stereotypes | ||
| * We currently only support languages that the underlying model supports; correctness of language use in languages other | ||
| than English may be poor depending on the language's coverage in the model's training data | ||
| * Make sure to test the app for whether it meets the use-case's quality requirements | ||
| * Customer support is available upon request, however we can't solve false or problematic output, most performance | ||
| issues, or other problems caused by the underlying model. Support is thus limited only to bugs directly caused by the | ||
| implementation of the app (connectors, API, front-end, AppAPI) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
System RAM or VRAM?