|
| 1 | +=================================================== |
| 2 | +App: Local Image Generation: Flux (text2image_flux) |
| 3 | +=================================================== |
| 4 | + |
| 5 | +.. _ai-app-text2image_flux: |
| 6 | + |
| 7 | +The *text2image_flux* app is one of the apps that provide image generation functionality in Nextcloud and act as an |
| 8 | +image generation backend for the :ref:`Nextcloud Assistant app<ai-app-assistant>` and :ref:`other apps making use of |
| 9 | +the image generation functionality<t2i-consumer-apps>`. It also provides image editing (image-to-image) from a text |
| 10 | +prompt. The *text2image_flux* app specifically runs only open source models and does so entirely on-premises. |
| 11 | +Nextcloud can provide customer support upon request, please talk to your account manager for the possibilities. |
| 12 | + |
| 13 | +Providers |
| 14 | +--------- |
| 15 | + |
| 16 | +The app registers the following Task Processing providers: |
| 17 | + |
| 18 | +* **Nextcloud Local Image Generation: Flux 2 Klein 4B** - text-to-image (``core:text2image``) |
| 19 | +* **Nextcloud Local Image Generation: Flux 2 Klein 4B (Enhanced)** - text-to-image with automatic prompt refinement |
| 20 | + via a text-to-text provider (``core:text2text``) before generation |
| 21 | +* **Nextcloud Local Image Editing: Flux 2 Klein 4B** - image editing from a prompt (``core:image2image`` on |
| 22 | + Nextcloud 36+; a custom ``text2image_flux:image2image`` task type on Nextcloud 35 and older) |
| 23 | + |
| 24 | +Select the providers in the Nextcloud AI admin settings. For the Enhanced provider, also install and enable a |
| 25 | +text-to-text backend such as :ref:`llm2<ai-app-llm2>`. |
| 26 | + |
| 27 | +Default output size is ``1024x1024``. You can override the size per task (``WxH`` format) or change the default via the |
| 28 | +``DEFAULT_SIZE`` deploy option (see :ref:`Configuration <ai-app-text2image_flux-configuration>` below). |
| 29 | + |
| 30 | +Requirements |
| 31 | +------------ |
| 32 | + |
| 33 | +* Minimal Nextcloud version: 30 |
| 34 | +* This app is built as an External App and thus depends on AppAPI v3.1.0 or higher |
| 35 | +* Nextcloud AIO is supported |
| 36 | +* We currently support NVIDIA GPUs and x86_64 CPUs |
| 37 | +* CUDA >= v12.2 on your host system |
| 38 | +* GPU Sizing |
| 39 | + |
| 40 | + * A NVIDIA GPU with at least 8GB VRAM (roughly 7GB used) |
| 41 | + * At least 8GB of system RAM |
| 42 | + |
| 43 | +* CPU Sizing |
| 44 | + |
| 45 | + * CPU inference is supported but very slow; for faster generation prefer a GPU or use |
| 46 | + :ref:`text2image_stablediffusion2<ai-app-text2image_stablediffusion2>` |
| 47 | + * At least 12GB of system RAM |
| 48 | + * The more cores you have and the more powerful the CPU the better, we recommend 10-20 cores |
| 49 | + * The app will hog all cores by default, so it is usually better to run it on a separate machine |
| 50 | + |
| 51 | +Installation |
| 52 | +------------ |
| 53 | + |
| 54 | +0. Make sure the :ref:`Nextcloud Assistant app<ai-app-assistant>` is installed |
| 55 | +1. :ref:`Install AppAPI and setup a Deploy Demon<ai-app_api>` |
| 56 | +2. Install the **Local Image Generation: Flux** ExApp via the "Apps" page in the Nextcloud web admin user interface |
| 57 | +3. Optionally install a text-to-text provider such as :ref:`llm2<ai-app-llm2>` if you want to use the Enhanced |
| 58 | + text-to-image provider |
| 59 | +4. Select the Flux providers in the Nextcloud AI admin settings |
| 60 | + |
| 61 | +.. _ai-app-text2image_flux-configuration: |
| 62 | + |
| 63 | +Configuration |
| 64 | +------------- |
| 65 | + |
| 66 | +You can set the following environment variables in the :ref:`Deploy Options <ai-app_api_deploy_options>` when installing |
| 67 | +or redeploying the ExApp: |
| 68 | + |
| 69 | +* ``NUM_INFERENCE_STEPS`` - Number of denoising steps used when generating or editing images. Default is ``4``. |
| 70 | +* ``DEFAULT_SIZE`` - Default size of generated or edited images in ``WxH`` format (for example ``1024x1024``). Used when |
| 71 | + no size is provided with the task. Default is ``1024x1024``. |
| 72 | + |
| 73 | +Scaling |
| 74 | +------- |
| 75 | + |
| 76 | +It is currently not possible to scale this app, we are working on this. Throughput is lower than with |
| 77 | +:ref:`text2image_stablediffusion2<ai-app-text2image_stablediffusion2>` because Flux generation is slower. We do |
| 78 | +appreciate real-world feedback on capacity. |
| 79 | + |
| 80 | +App store |
| 81 | +--------- |
| 82 | + |
| 83 | +You can also find the app in our app store, where you can write a review: |
| 84 | +`<https://apps.nextcloud.com/apps/text2image_flux>`_ |
| 85 | + |
| 86 | +Repository |
| 87 | +---------- |
| 88 | + |
| 89 | +You can find the app's code repository on GitHub where you can report bugs and contribute fixes and features: |
| 90 | +`<https://github.com/nextcloud/text2image_flux>`_ |
| 91 | + |
| 92 | +Nextcloud customers should file bugs directly with our Support system. |
| 93 | + |
| 94 | +Ethical AI Rating |
| 95 | +----------------- |
| 96 | + |
| 97 | +**Rating: Yellow** |
| 98 | + |
| 99 | +Positive: |
| 100 | + |
| 101 | +* The software for training and inferencing of this model is open source |
| 102 | +* The trained model is freely available under Apache 2.0, and thus can be run on-premises |
| 103 | + |
| 104 | +Negative: |
| 105 | + |
| 106 | +* The training data is not freely available, making it not possible to check or correct for bias or optimise the |
| 107 | + performance and CO2 usage |
| 108 | + |
| 109 | +Learn more about the Nextcloud Ethical AI Rating |
| 110 | +`in our blog <https://nextcloud.com/blog/nextcloud-ethical-ai-rating/>`_. |
| 111 | + |
| 112 | +Known Limitations |
| 113 | +----------------- |
| 114 | + |
| 115 | +* Image generation and editing are slower than with |
| 116 | + :ref:`text2image_stablediffusion2<ai-app-text2image_stablediffusion2>`; prefer that app if speed matters more than quality |
| 117 | +* The Enhanced provider depends on a working text-to-text Task Processing provider; if prompt improvement fails, the original prompt is used |
| 118 | +* Faces and people in general may not be generated properly |
| 119 | +* The results for certain image generation requests can be biased and may enforce stereotypes |
| 120 | +* We currently only support languages that the underlying model supports; correctness of language use in languages other |
| 121 | + than English may be poor depending on the language's coverage in the model's training data |
| 122 | +* Make sure to test the app for whether it meets the use-case's quality requirements |
| 123 | +* Customer support is available upon request, however we can't solve false or problematic output, most performance |
| 124 | + issues, or other problems caused by the underlying model. Support is thus limited only to bugs directly caused by the |
| 125 | + implementation of the app (connectors, API, front-end, AppAPI) |
0 commit comments