diff --git a/cloud-infrastructure/ai-infra-gpu/ai-infrastructure/flux-1-finetuning/LICENSE b/cloud-infrastructure/ai-infra-gpu/ai-infrastructure/flux-1-finetuning/LICENSE new file mode 100644 index 000000000..289625aa4 --- /dev/null +++ b/cloud-infrastructure/ai-infra-gpu/ai-infrastructure/flux-1-finetuning/LICENSE @@ -0,0 +1,35 @@ +Copyright (c) 2021, 2023 Oracle and/or its affiliates. + +The Universal Permissive License (UPL), Version 1.0 + +Subject to the condition set forth below, permission is hereby granted to any +person obtaining a copy of this software, associated documentation and/or data +(collectively the "Software"), free of charge and under any and all copyright +rights in the Software, and any and all patent rights owned or freely +licensable by each licensor hereunder covering either (i) the unmodified +Software as contributed to or provided by such licensor, or (ii) the Larger +Works (as defined below), to deal in both + +(a) the Software, and +(b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +one is included with the Software (each a "Larger Work" to which the Software +is contributed by such licensors), + +without restriction, including without limitation the rights to copy, create +derivative works of, display, perform, and distribute the Software and make, +use, sell, offer for sale, import, export, have made, and have sold the +Software and the Larger Work(s), and to sublicense the foregoing rights on +either these or other terms. + +This license is subject to the following condition: +The above copyright notice and either this complete permission notice or at +a minimum a reference to the UPL must be included in all copies or +substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/cloud-infrastructure/ai-infra-gpu/ai-infrastructure/flux-1-finetuning/README.md b/cloud-infrastructure/ai-infra-gpu/ai-infrastructure/flux-1-finetuning/README.md new file mode 100644 index 000000000..f2abfcaa8 --- /dev/null +++ b/cloud-infrastructure/ai-infra-gpu/ai-infrastructure/flux-1-finetuning/README.md @@ -0,0 +1,138 @@ +# flux-1-finetuning + +This repo is designed to quickly prepare a demo that showcases how to use OCI GPU shapes to finetune lora models of flux.1-dev. + +Flux is a set of diffusion models created by BlackForest Labs, and are subject to [licensing terms](https://github.com/black-forest-labs/flux/blob/main/model_licenses/LICENSE-FLUX1-dev) +In this blog we will show how to fine tune flux.1-dev that is available in [HuggingFace](https://huggingface.co/black-forest-labs/FLUX.1-dev) + +There are several projects that can be used to work with flux models +- [ComfyUI](https://github.com/comfyanonymous/ComfyUI) is a powerful and user-friendly tool for creating high-quality images using AI, including the FLUX model. It offers a modular workflow design that allows users to create custom image generation processes by connecting different components +- [AItoolkit](https://github.com/comfyanonymous/ComfyUI) is a tool that simplifies Flux fine tuning experience expoecially to reduce VRAM requirements. +- [SimpleTuner](https://github.com/bghira/SimpleTuner) is a set of scripts that simplify distributed fine tuning on multiple GPUs + +Prerequisites: +- Linux based GPU VM with recent Nvidia driver and Cuda toolkit +- git, Miniconda installed +- An account in HuggingFace where you can login with huggingface-cli login + +## Installing AI toolkit ## + +use aitoolkit.yaml to prepare a conda environment with the required packages + +``` +conda create env -f aitoolkit.yaml +conda activate aitoolkit +``` + +then you can clone the ai-toolkit +``` +git clone https://github.com/ostris/ai-toolkit.git +cd ai-toolkit +git submodule update --init --recursive +``` + +## Dataset generation ## + +You can take 20-30 pictures of yourself.Use high-resolution images, ideally at least 1024x1024 pixels. If your images are larger, crop them to a 1:1 aspect ratio (square), centering your face or the main subject in each image. Ensure all images are sharp, in focus, and free of blur or artifacts. Avoid including any low-quality or poorly lit images. Each image should feature only you as the main subject, clearly visible and centered. Avoid group photos or images with distracting backgrounds. Maximize diversity by taking photos in different environments, with varied backgrounds, lighting conditions, facial expressions, and outfits. This helps the model generalize and prevents overfitting to a single look or scenario + + +## Training + +Aitoolkit has a large set of options that can be exploited to train a lora model for flux1. You can find examples in the directory config/examples/. +According to the different GPUs you can use them to either reduce video memory consumption, or to improve training performance. + + +- folder_path: "/path/to/images/folder" , speicfy where the dataset is +- gradient_checkpointing: true This feature allows to reduce memory footprint, but this increases computation time by about 35%. On large memory GPUs it is convenient to set it to false. +- model:quantize: true This uses intermediate 8bit quantization to reduce memory footprint, the final model will still be 16bits, so turn it on only on small GPUs. +- model:low_vram: true This further reduces memory footprint on very small GPUs. +- prompts: this is a list of prompts that are used the create intermidiate images to chck quality, for analyzing performances you can remove them +- batch_size: 1 increasing batch size on a single GPU deteriorates performance, recommended to stick with 1. +- trigger_word: a GPU Specialist Here you set the keyword that you can use in the prompt. + +## Installing ComfyUI + +ComfyUI can be used the test the generated lora model. It can be installed in the same conda env as Attoolkit + +``` +git clone https://github.com/comfyanonymous/ComfyUI/tree/v0.3.10 +cd ComfyUI +python main.py +``` + +You can connect to the ComfyUI GUI by pointing your browser to port 8188, according to the network configuration a port forward might be required. + +Then you need to import models that are required by the workflow. + +Download the [Clip Safetensor](https://huggingface.co/comfyanonymous/flux_text_encoders/blob/main/clip_l.safetensors) to ComfyUI/models/clip/ +This model plays a crucial role in text-to-image generation tasks by processing and encoding textual input. + +Download the Text Encoder [T5xxl Safetensor](https://huggingface.co/comfyanonymous/flux_text_encoders/blob/main/t5xxl_fp8_e4m3fn.safetensors) to ComfyUI/models/clip/ + +Download the [VAE Safetensor](https://huggingface.co/black-forest-labs/FLUX.1-schnell/blob/main/ae.safetensors) to ComfyUI/models/vae + +Download the [Flux.1-dev UNET model](https://huggingface.co/black-forest-labs/FLUX.1-dev/tree/main) to ComfyUI/models/unet + +## Testing Lora models with ComfyUI + +Everytime you create a lora model with Ai-toolkit you can copy it to ComfyUI/models/lora + +Import the workflow by opening the file workflow-lora.json + +You will then be able to select the model in the Load Lora box. Make sure also the proper models are selected in the Load diffusion Model, DualCLIPLoader, and Load VAE boxes. + +You can write your own prompt in the CLIP Text Encode box, remeber to refer to the keyword used for training the Lora. +![Alt text](files/ComfyUI.png?raw=true "ComfyUI Lora workflow") + +## Installing SimpleTuner + +``` +git clone --branch=release https://github.com/bghira/SimpleTuner.git +``` +Copy config/config.json.example to config/config.json + +Then you execute the training with + +``` +./train.sh +``` + +Parallel training is possible using Accelerate (the Deepspeed implementation on Flux is buggy at the time of writing. +When more GPUs are used, the batch size is increased automatically, so the number os steps required to process one full epoch is riduced proportionally. + + +If present the Accelerate configuration will be taken from the config file in + +~/.cache/huggingface/accelerate/default_config.yaml + +``` +compute_environment: LOCAL_MACHINE +debug: false +distributed_type: *MULTI_GPU* +downcast_bf16: 'no' +enable_cpu_affinity: true +gpu_ids: all +machine_rank: 0 +main_training_function: main +mixed_precision: bf16 +num_machines: 1 +num_processes: 4 +rdzv_backend: static +same_network: true +tpu_env: [] +tpu_use_cluster: false +tpu_use_sudo: false +use_cpu: false +``` + +If this file is not present you can create a file config/config.env and use it to set this environmental variable: + +``` +TRAINING_NUM_PROCESSES=4 +``` + + + + + + diff --git a/cloud-infrastructure/ai-infra-gpu/ai-infrastructure/flux-1-finetuning/files/ComfyUI.png b/cloud-infrastructure/ai-infra-gpu/ai-infrastructure/flux-1-finetuning/files/ComfyUI.png new file mode 100644 index 000000000..95e9217c4 Binary files /dev/null and b/cloud-infrastructure/ai-infra-gpu/ai-infrastructure/flux-1-finetuning/files/ComfyUI.png differ diff --git a/cloud-infrastructure/ai-infra-gpu/ai-infrastructure/flux-1-finetuning/files/aitoolkit.yaml b/cloud-infrastructure/ai-infra-gpu/ai-infrastructure/flux-1-finetuning/files/aitoolkit.yaml new file mode 100644 index 000000000..b60bd7543 --- /dev/null +++ b/cloud-infrastructure/ai-infra-gpu/ai-infrastructure/flux-1-finetuning/files/aitoolkit.yaml @@ -0,0 +1,173 @@ +name: aitoolkit +channels: + - defaults + - https://repo.anaconda.com/pkgs/main + - https://repo.anaconda.com/pkgs/r +dependencies: + - _libgcc_mutex=0.1=main + - _openmp_mutex=5.1=1_gnu + - bzip2=1.0.8=h5eee18b_6 + - ca-certificates=2024.11.26=h06a4308_0 + - ld_impl_linux-64=2.40=h12ee557_0 + - libffi=3.4.4=h6a678d5_1 + - libgcc-ng=11.2.0=h1234567_1 + - libgomp=11.2.0=h1234567_1 + - libstdcxx-ng=11.2.0=h1234567_1 + - libuuid=1.41.5=h5eee18b_0 + - ncurses=6.4=h6a678d5_0 + - openssl=3.0.15=h5eee18b_0 + - pip=24.2=py311h06a4308_0 + - python=3.11.10=he870216_0 + - readline=8.2=h5eee18b_0 + - setuptools=75.1.0=py311h06a4308_0 + - sqlite=3.45.3=h5eee18b_0 + - tk=8.6.14=h39e8969_0 + - wheel=0.44.0=py311h06a4308_0 + - xz=5.4.6=h5eee18b_1 + - zlib=1.2.13=h5eee18b_1 + - pip: + - absl-py==2.1.0 + - accelerate==1.2.1 + - aiofiles==23.2.1 + - albucore==0.0.16 + - albumentations==1.4.15 + - annotated-types==0.7.0 + - antlr4-python3-runtime==4.9.3 + - anyio==4.7.0 + - attrs==24.3.0 + - bitsandbytes==0.45.0 + - certifi==2024.12.14 + - charset-normalizer==3.4.0 + - clean-fid==0.1.35 + - click==8.1.7 + - clip-anytorch==2.6.0 + - controlnet-aux==0.0.7 + - dctorch==0.1.2 + - diffusers==0.32.0.dev0 + - docker-pycreds==0.4.0 + - einops==0.8.0 + - eval-type-backport==0.2.0 + - fastapi==0.115.6 + - ffmpy==0.5.0 + - filelock==3.16.1 + - flatten-json==0.1.14 + - fsspec==2024.12.0 + - ftfy==6.3.1 + - gitdb==4.0.11 + - gitpython==3.1.43 + - gradio==5.9.1 + - gradio-client==1.5.2 + - grpcio==1.68.1 + - h11==0.14.0 + - hf-transfer==0.1.8 + - httpcore==1.0.7 + - httpx==0.28.1 + - huggingface-hub==0.27.0 + - idna==3.10 + - imageio==2.36.1 + - importlib-metadata==8.5.0 + - invisible-watermark==0.2.0 + - jinja2==3.1.4 + - jsonmerge==1.9.2 + - jsonschema==4.23.0 + - jsonschema-specifications==2024.10.1 + - k-diffusion==0.1.1.post1 + - kornia==0.7.4 + - kornia-rs==0.1.7 + - lazy-loader==0.4 + - lpips==0.1.4 + - lycoris-lora==1.8.3 + - markdown==3.7 + - markdown-it-py==3.0.0 + - markupsafe==2.1.5 + - mdurl==0.1.2 + - mpmath==1.3.0 + - networkx==3.4.2 + - ninja==1.11.1.3 + - numpy==1.26.4 + - nvidia-cublas-cu12==12.4.5.8 + - nvidia-cuda-cupti-cu12==12.4.127 + - nvidia-cuda-nvrtc-cu12==12.4.127 + - nvidia-cuda-runtime-cu12==12.4.127 + - nvidia-cudnn-cu12==9.1.0.70 + - nvidia-cufft-cu12==11.2.1.3 + - nvidia-curand-cu12==10.3.5.147 + - nvidia-cusolver-cu12==11.6.1.9 + - nvidia-cusparse-cu12==12.3.1.170 + - nvidia-nccl-cu12==2.21.5 + - nvidia-nvjitlink-cu12==12.4.127 + - nvidia-nvtx-cu12==12.4.127 + - omegaconf==2.3.0 + - open-clip-torch==2.29.0 + - opencv-python==4.10.0.84 + - opencv-python-headless==4.10.0.84 + - optimum-quanto==0.2.4 + - orjson==3.10.12 + - oyaml==1.0 + - packaging==24.2 + - pandas==2.2.3 + - peft==0.14.0 + - pillow==11.0.0 + - platformdirs==4.3.6 + - prodigyopt==1.1.1 + - protobuf==5.29.2 + - psutil==6.1.1 + - pydantic==2.10.4 + - pydantic-core==2.27.2 + - pydub==0.25.1 + - pygments==2.18.0 + - python-dateutil==2.9.0.post0 + - python-dotenv==1.0.1 + - python-multipart==0.0.20 + - python-slugify==8.0.4 + - pytorch-fid==0.3.0 + - pytz==2024.2 + - pywavelets==1.8.0 + - pyyaml==6.0.2 + - referencing==0.35.1 + - regex==2024.11.6 + - requests==2.32.3 + - rich==13.9.4 + - rpds-py==0.22.3 + - ruff==0.8.4 + - safehttpx==0.1.6 + - safetensors==0.4.5 + - scikit-image==0.25.0 + - scipy==1.14.1 + - semantic-version==2.10.0 + - sentencepiece==0.2.0 + - sentry-sdk==2.19.2 + - setproctitle==1.3.4 + - shellingham==1.5.4 + - six==1.17.0 + - smmap==5.0.1 + - sniffio==1.3.1 + - starlette==0.41.3 + - sympy==1.13.1 + - tensorboard==2.18.0 + - tensorboard-data-server==0.7.2 + - text-unidecode==1.3 + - tifffile==2024.12.12 + - timm==1.0.12 + - tokenizers==0.21.0 + - toml==0.10.2 + - tomlkit==0.13.2 + - torch==2.5.1 + - torchdiffeq==0.2.5 + - torchsde==0.2.6 + - torchvision==0.20.1 + - tqdm==4.67.1 + - trampoline==0.1.2 + - transformers==4.47.1 + - triton==3.1.0 + - typer==0.15.1 + - typing-extensions==4.12.2 + - tzdata==2024.2 + - urllib3==2.2.3 + - uvicorn==0.34.0 + - wandb==0.19.1 + - wcwidth==0.2.13 + - websockets==14.1 + - werkzeug==3.1.3 + - zipp==3.21.0 +prefix: /home/ubuntu/anaconda3/envs/aitoolkit2 diff --git a/cloud-infrastructure/ai-infra-gpu/ai-infrastructure/flux-1-finetuning/files/simpletuner.yaml b/cloud-infrastructure/ai-infra-gpu/ai-infrastructure/flux-1-finetuning/files/simpletuner.yaml new file mode 100644 index 000000000..4ce51267d --- /dev/null +++ b/cloud-infrastructure/ai-infra-gpu/ai-infrastructure/flux-1-finetuning/files/simpletuner.yaml @@ -0,0 +1,268 @@ +name: simpletuner +channels: + - defaults + - https://repo.anaconda.com/pkgs/main + - https://repo.anaconda.com/pkgs/r +dependencies: + - _libgcc_mutex=0.1=main + - _openmp_mutex=5.1=1_gnu + - bzip2=1.0.8=h5eee18b_6 + - ca-certificates=2024.11.26=h06a4308_0 + - ld_impl_linux-64=2.40=h12ee557_0 + - libffi=3.4.4=h6a678d5_1 + - libgcc-ng=11.2.0=h1234567_1 + - libgomp=11.2.0=h1234567_1 + - libstdcxx-ng=11.2.0=h1234567_1 + - libuuid=1.41.5=h5eee18b_0 + - ncurses=6.4=h6a678d5_0 + - openssl=3.0.15=h5eee18b_0 + - python=3.11.10=he870216_0 + - readline=8.2=h5eee18b_0 + - sqlite=3.45.3=h5eee18b_0 + - tk=8.6.14=h39e8969_0 + - wheel=0.44.0=py311h06a4308_0 + - xz=5.4.6=h5eee18b_1 + - zlib=1.2.13=h5eee18b_1 + - pip: + - absl-py==2.1.0 + - accelerate==1.2.1 + - aiofiles==23.2.1 + - aiohappyeyeballs==2.4.3 + - aiohttp==3.10.10 + - aiosignal==1.3.1 + - albucore==0.0.16 + - albumentations==1.4.15 + - annotated-types==0.7.0 + - antlr4-python3-runtime==4.9.3 + - anyio==4.6.2.post1 + - atomicwrites==1.4.1 + - attrs==24.2.0 + - bitsandbytes==0.45.0 + - boto3==1.35.83 + - botocore==1.35.83 + - build==1.2.2.post1 + - cachecontrol==0.14.1 + - certifi==2024.8.30 + - cffi==1.17.1 + - chardet==5.2.0 + - charset-normalizer==3.4.0 + - clean-fid==0.1.35 + - cleo==2.1.0 + - click==8.1.7 + - clip-anytorch==2.6.0 + - clip-interrogator==0.6.0 + - colorama==0.4.6 + - compel==2.0.3 + - controlnet-aux==0.0.7 + - crashtest==0.4.1 + - cryptography==44.0.0 + - dataproperty==1.0.1 + - datasets==3.0.2 + - dctorch==0.1.2 + - deepspeed==0.16.1 + - diffusers==0.32.0.dev0 + - dill==0.3.8 + - distlib==0.3.9 + - dnspython==2.7.0 + - docker-pycreds==0.4.0 + - dulwich==0.21.7 + - einops==0.8.0 + - email-validator==2.2.0 + - eval-type-backport==0.2.0 + - evaluate==0.4.3 + - fastapi==0.115.3 + - fastapi-cli==0.0.5 + - fastjsonschema==2.21.1 + - ffmpy==0.4.0 + - filelock==3.16.1 + - flatten-json==0.1.14 + - frozenlist==1.5.0 + - fsspec==2024.9.0 + - ftfy==6.3.0 + - gitdb==4.0.11 + - gitpython==3.1.43 + - gradio==5.9.1 + - gradio-client==1.5.2 + - grpcio==1.67.0 + - h11==0.14.0 + - hf-transfer==0.1.8 + - hjson==3.1.0 + - httpcore==1.0.6 + - httptools==0.6.4 + - httpx==0.27.2 + - huggingface-hub==0.26.1 + - idna==3.10 + - imageio==2.36.1 + - importlib-metadata==8.5.0 + - installer==0.7.0 + - invisible-watermark==0.2.0 + - iterutils==0.1.6 + - jaraco-classes==3.4.0 + - jeepney==0.8.0 + - jinja2==3.1.4 + - jmespath==1.0.1 + - joblib==1.4.2 + - jsonlines==4.0.0 + - jsonmerge==1.9.2 + - jsonschema==4.23.0 + - jsonschema-specifications==2024.10.1 + - k-diffusion==0.1.1.post1 + - keyring==24.3.1 + - kornia==0.7.4 + - kornia-rs==0.1.7 + - lazy-loader==0.4 + - lightning-utilities==0.11.8 + - lm-eval==0.4.5 + - lpips==0.1.4 + - lxml==5.3.0 + - lycoris-lora==3.1.1.post1 + - markdown==3.7 + - markdown-it-py==3.0.0 + - markupsafe==3.0.2 + - mbstrdecoder==1.1.3 + - mdurl==0.1.2 + - more-itertools==10.5.0 + - mpmath==1.3.0 + - msgpack==1.1.0 + - multidict==6.1.0 + - multiprocess==0.70.16 + - networkx==3.4.2 + - ninja==1.11.1.1 + - nltk==3.9.1 + - numexpr==2.10.1 + - numpy==2.2.0 + - nvidia-cublas-cu12==12.4.5.8 + - nvidia-cuda-cupti-cu12==12.4.127 + - nvidia-cuda-nvrtc-cu12==12.4.127 + - nvidia-cuda-runtime-cu12==12.4.127 + - nvidia-cudnn-cu12==9.1.0.70 + - nvidia-cufft-cu12==11.2.1.3 + - nvidia-curand-cu12==10.3.5.147 + - nvidia-cusolver-cu12==11.6.1.9 + - nvidia-cusparse-cu12==12.3.1.170 + - nvidia-cusparselt-cu12==0.6.2 + - nvidia-nccl-cu12==2.21.5 + - nvidia-nvjitlink-cu12==12.4.127 + - nvidia-nvtx-cu12==12.4.127 + - omegaconf==2.3.0 + - open-clip-torch==2.28.0 + - opencv-python==4.10.0.84 + - opencv-python-headless==4.10.0.84 + - optimum-quanto==0.2.6.dev0 + - orjson==3.10.12 + - oyaml==1.0 + - packaging==24.1 + - pandas==2.2.3 + - pathvalidate==3.2.1 + - peft==0.14.0 + - pexpect==4.9.0 + - pillow==11.0.0 + - pip==24.3.1 + - pkginfo==1.12.0 + - platformdirs==4.3.6 + - poetry==1.8.5 + - poetry-core==1.9.1 + - poetry-plugin-export==1.8.0 + - portalocker==2.10.1 + - prodigyopt==1.1 + - propcache==0.2.0 + - protobuf==5.28.3 + - psutil==6.1.0 + - ptyprocess==0.7.0 + - py-cpuinfo==9.0.0 + - pyarrow==17.0.0 + - pybind11==2.13.6 + - pycparser==2.22 + - pydantic==2.9.2 + - pydantic-core==2.23.4 + - pydub==0.25.1 + - pygments==2.18.0 + - pyparsing==3.2.0 + - pyproject-hooks==1.2.0 + - pytablewriter==1.2.0 + - python-dateutil==2.9.0.post0 + - python-dotenv==1.0.1 + - python-multipart==0.0.12 + - python-slugify==8.0.4 + - pytorch-fid==0.3.0 + - pytorch-triton==3.2.0+gitf9cdf582 + - pytz==2024.2 + - pywavelets==1.8.0 + - pyyaml==6.0.2 + - rapidfuzz==3.11.0 + - referencing==0.35.1 + - regex==2024.9.11 + - requests==2.32.3 + - requests-toolbelt==1.0.0 + - rich==13.9.3 + - rouge-score==0.1.2 + - rpds-py==0.22.3 + - ruff==0.8.3 + - s3transfer==0.10.3 + - sacrebleu==2.4.3 + - safehttpx==0.1.6 + - safetensors==0.4.5 + - scikit-image==0.25.0 + - scikit-learn==1.5.2 + - scipy==1.14.1 + - secretstorage==3.3.3 + - semantic-version==2.10.0 + - sentencepiece==0.2.0 + - sentry-sdk==2.17.0 + - setproctitle==1.3.3 + - setuptools==75.2.0 + - shellingham==1.5.4 + - six==1.16.0 + - smmap==5.0.1 + - sniffio==1.3.1 + - soundfile==0.12.1 + - spandrel==0.4.0 + - sqlitedict==2.1.0 + - starlette==0.41.0 + - sympy==1.13.1 + - tabledata==1.3.3 + - tabulate==0.9.0 + - tcolorpy==0.1.6 + - tensorboard==2.18.0 + - tensorboard-data-server==0.7.2 + - text-unidecode==1.3 + - threadpoolctl==3.5.0 + - tifffile==2024.12.12 + - timm==1.0.11 + - tokenizers==0.21.0 + - toml==0.10.2 + - tomlkit==0.13.2 + - torch==2.5.1+cu124 + - torch-optimi==0.2.1 + - torchao==0.7.0 + - torchaudio==2.5.1 + - torchdiffeq==0.2.5 + - torchmetrics==1.6.0 + - torchsde==0.2.6 + - torchvision==0.20.1+cu124 + - tqdm==4.66.5 + - tqdm-multiprocess==0.0.11 + - trampoline==0.1.2 + - transformers==4.47.1 + - triton==3.1.0 + - triton-library==1.0.0rc4 + - trove-classifiers==2024.10.21.16 + - typepy==1.3.2 + - typer==0.12.5 + - typing-extensions==4.12.2 + - tzdata==2024.2 + - urllib3==1.26.20 + - uvicorn==0.32.0 + - uvloop==0.21.0 + - virtualenv==20.28.0 + - wandb==0.19.1 + - watchfiles==0.24.0 + - wcwidth==0.2.13 + - websockets==13.1 + - werkzeug==3.0.4 + - word2number==1.1 + - xxhash==3.5.0 + - yarl==1.16.0 + - zipp==3.20.2 + - zstandard==0.23.0 +prefix: /home/ubuntu/anaconda3/envs/aitoolkit diff --git a/cloud-infrastructure/ai-infra-gpu/ai-infrastructure/flux-1-finetuning/files/workflow-lora.json b/cloud-infrastructure/ai-infra-gpu/ai-infrastructure/flux-1-finetuning/files/workflow-lora.json new file mode 100644 index 000000000..12df33d89 --- /dev/null +++ b/cloud-infrastructure/ai-infra-gpu/ai-infrastructure/flux-1-finetuning/files/workflow-lora.json @@ -0,0 +1 @@ +{"last_node_id":25,"last_link_id":34,"nodes":[{"id":1,"type":"CLIPTextEncode","pos":[1974,-52],"size":[271.27862548828125,162.67477416992188],"flags":{},"order":5,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":25,"label":"CLIP"}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[10],"slot_index":0,"label":"条件"}],"properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":["A captivating photograph showcases a girl playing a guitar amidst an epic sea of flowers, with the same lush flora stretching out as a vibrant backdrop. The image is rendered in stunning cinematic detail and resolution (4K), exuding a sense of grandeur that echoes both vintage and modern sensibilities. The photograph was shot on Kodak film stock to achieve a highly detailed, grainy aesthetic reminiscent of classic cinema and found footage. A vignette effect adds depth and moodiness to the image, while elements like visible imperfections and stains contribute to its authenticity and vintage charm. Inspired by both HBO's cinematic style and Lomography techniques, this photograph evokes a darker, more emotive atmosphere that transports viewers into",[false,true]],"color":"#232","bgcolor":"#353"},{"id":2,"type":"VAEDecode","pos":[2629,-55],"size":[210,46],"flags":{},"order":9,"mode":0,"inputs":[{"name":"samples","type":"LATENT","link":3,"label":"Latent"},{"name":"vae","type":"VAE","link":34,"label":"VAE"}],"outputs":[{"name":"IMAGE","type":"IMAGE","links":[12],"slot_index":0,"label":"图像"}],"properties":{"Node name for S&R":"VAEDecode"},"widgets_values":[]},{"id":5,"type":"FluxGuidance","pos":[2321,-41],"size":[211.60000610351562,58],"flags":{},"order":7,"mode":0,"inputs":[{"name":"conditioning","type":"CONDITIONING","link":10,"label":"条件"}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[6],"slot_index":0,"shape":3,"label":"条件"}],"properties":{"Node name for S&R":"FluxGuidance"},"widgets_values":[3.5]},{"id":4,"type":"CLIPTextEncode","pos":[1802.0966796875,174.20407104492188],"size":[422.84503173828125,164.31304931640625],"flags":{"collapsed":false},"order":6,"mode":0,"inputs":[{"name":"clip","type":"CLIP","link":26,"slot_index":0,"label":"CLIP"}],"outputs":[{"name":"CONDITIONING","type":"CONDITIONING","links":[27],"slot_index":0,"label":"条件"}],"properties":{"Node name for S&R":"CLIPTextEncode"},"widgets_values":["",[false,true]],"color":"#322","bgcolor":"#533"},{"id":22,"type":"EmptySD3LatentImage","pos":[1883.0242919921875,438.84796142578125],"size":[315,106],"flags":{},"order":0,"mode":0,"inputs":[],"outputs":[{"name":"LATENT","type":"LATENT","links":[31],"slot_index":0,"shape":3,"label":"Latent"}],"properties":{"Node name for S&R":"EmptySD3LatentImage"},"widgets_values":[1024,1024,1]},{"id":7,"type":"SaveImage","pos":[2621.163330078125,89.83655548095703],"size":[320.24383544921875,369.1311340332031],"flags":{},"order":10,"mode":0,"inputs":[{"name":"images","type":"IMAGE","link":12,"label":"图像"}],"outputs":[],"properties":{"Node name for S&R":"SaveImage"},"widgets_values":["flux/20240927/ComfyUI"]},{"id":3,"type":"KSampler","pos":[2309.581787109375,85.20913696289062],"size":[273.9103698730469,474],"flags":{},"order":8,"mode":0,"inputs":[{"name":"model","type":"MODEL","link":24,"label":"模型"},{"name":"positive","type":"CONDITIONING","link":6,"label":"正面条件"},{"name":"negative","type":"CONDITIONING","link":27,"label":"负面条件"},{"name":"latent_image","type":"LATENT","link":31,"label":"Latent"}],"outputs":[{"name":"LATENT","type":"LATENT","links":[3],"slot_index":0,"shape":3,"label":"Latent"}],"properties":{"Node name for S&R":"KSampler"},"widgets_values":[460294761431437,"randomize",30,1,"euler","beta",1]},{"id":23,"type":"UNETLoader","pos":[1083.1336669921875,-29.674314498901367],"size":[315,82],"flags":{},"order":1,"mode":0,"inputs":[],"outputs":[{"name":"MODEL","type":"MODEL","links":[32],"slot_index":0}],"properties":{"Node name for S&R":"UNETLoader"},"widgets_values":["flux1-dev.sft","fp8_e4m3fn"]},{"id":24,"type":"DualCLIPLoader","pos":[1083.0443115234375,133.7061004638672],"size":[315,106],"flags":{},"order":2,"mode":0,"inputs":[],"outputs":[{"name":"CLIP","type":"CLIP","links":[33],"slot_index":0}],"properties":{"Node name for S&R":"DualCLIPLoader"},"widgets_values":["clip_l.safetensors","t5xxl_fp16.safetensors","flux"]},{"id":25,"type":"VAELoader","pos":[1091.5242919921875,310.4281921386719],"size":[315,58],"flags":{},"order":3,"mode":0,"inputs":[],"outputs":[{"name":"VAE","type":"VAE","links":[34],"slot_index":0}],"properties":{"Node name for S&R":"VAELoader"},"widgets_values":["ae.safetensors"]},{"id":20,"type":"LoraLoader","pos":[1483.94091796875,-44.88408660888672],"size":[460.11383056640625,139.3437957763672],"flags":{},"order":4,"mode":0,"inputs":[{"name":"model","type":"MODEL","link":32,"label":"模型"},{"name":"clip","type":"CLIP","link":33,"label":"CLIP"}],"outputs":[{"name":"MODEL","type":"MODEL","links":[24],"slot_index":0,"shape":3,"label":"模型"},{"name":"CLIP","type":"CLIP","links":[25,26],"slot_index":1,"shape":3,"label":"CLIP"}],"properties":{"Node name for S&R":"LoraLoader"},"widgets_values":["flux.1\\背景防模糊\\FLUX-dev-lora-AntiBlur.safetensors",1,1]}],"links":[[3,3,0,2,0,"LATENT"],[6,5,0,3,1,"CONDITIONING"],[10,1,0,5,0,"CONDITIONING"],[12,2,0,7,0,"IMAGE"],[24,20,0,3,0,"MODEL"],[25,20,1,1,0,"CLIP"],[26,20,1,4,0,"CLIP"],[27,4,0,3,2,"CONDITIONING"],[31,22,0,3,3,"LATENT"],[32,23,0,20,0,"MODEL"],[33,24,0,20,1,"CLIP"],[34,25,0,2,1,"VAE"]],"groups":[],"config":{},"extra":{"ds":{"scale":0.7627768444385981,"offset":[-1004.4870145478208,158.86624901084315]},"ue_links":[]},"version":0.4} \ No newline at end of file