Нейронные сети (картинки)
StableDifusion
Установка
1. Установить гит https://git-scm.com/download/win 2. Установить python 3.10.6 (https://www.python.org/downloads/windows/) c галкой add to PATH 3. Установить CUDA https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exe_local 4. в git bush (или в VC в терминале) git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui Создаст папку там где запущен баш (C:\Users\Misha\stable-diffusion-webui) git pull — чтобы обновить (из папки stable-diffusion-webui) Или скачать https://github.com/AUTOMATIC1111/stable-diffusion-webui/archive/refs/tags/v1.6.0.zip 5. Запустить webui-user.bat (ждать 15 мин) Если ловим ошибку TypeError: AsyncConnectionPool.__init__() got an unexpected keyword argument ‘socket_options’
source venv/Scripts/activate
pip install httpx==0.24.1
Для автоматического обновления — дописать в код webui-user.bat
@echo off
set PYTHON=
set GIT=
set VENV_DIR=
set COMMANDLINE_ARGS= --autolaunch --xformers --medvram --opt-sdp-attention
git pull
call webui.bat
Если xformers не поставился
set COMMANDLINE_ARGS= --reinstall-xformers --xformers
xformers нужен для снижения нагрузки на видеокарту, работает на архитектурах: turing, hopper, pascal, ampere, ada lovelace 6. Ставим свои модели в C:\StableDifusion\stable-diffusion-webui-1.6.0\models\Stable-diffusion 7. Чтобы поменять значения при запуске — редактировать ui-config.json
Автономная версия (xrist)
Не работают XL модели https://github.com/serpotapov/stable-diffusion-portable разархивировать — webui-user-first-run.cmd Модели ставить сюда C:\stable-diffusion-portable-main\models\Stable-diffusion\ Запускать тут webui-user.bat
Дополнительные модели
https://civitai.com/models https://huggingface.co/XpucT/Deliberate/tree/main mj — в начале промта чтобы эмулировать стиль миджорни cinematic — добавить кинематографичности cozy — добавить уюта https://civitai.com/models/125703/protovision-xl-high-fidelity-3d-photorealism-anime-hyperrealism-no-refiner-needed
Локальный сервер
Отредактировать webui.py def webui():
app, local_url, share_url = shared.demo.launch(
#share=cmd_opts.share,
share=True,
server_name=server_name,
server_port=cmd_opts.port,
ssl_keyfile=cmd_opts.tls_keyfile,
ssl_certfile=cmd_opts.tls_certfile,
debug=cmd_opts.gradio_debug,
auth=[tuple(cred.split(':')) for cred in gradio_auth_creds] if gradio_auth_creds else None,
inbrowser=cmd_opts.autolaunch,
prevent_thread_lock=True
)
Обучение на LORA
https://github.com/serpotapov/Kohya_ss-GUI-LoRA-Portable Для каждой версии семплера — отдельная лора (1.5; XL) Extra networks — Add hypernetwork to promt — none (для обучений) Путь куда класть фотки (примерно 16) Тренировать на 2й вкладке — dreamboots Lora C:_StableDifusion\Train\100_Misha В настройках указать папку в которой лежит папка 100_Misha При начале трейна сразу удалять появившуюся папку smple
Дополнительные аддоны
На вкладке Extentions Ставятся в C:\_StableDifusion\stable-diffusion-portable-main\extensions\ dynamic thresholding — https://github.com/mcmonkeyprojects/sd-dynamic-thresholding ControlNet В Extension: sd-webui-controlnet manipulations Сами модели https://huggingface.co/lllyasviel/ControlNet/tree/main/models Ставить сюда C:_StableDifusion\stable-diffusion-portable-main\extensions\sd-webui-controlnet\models canny — контуры mlsd — интерьеры openpose — копирование поз scribble — раскраска скетча Scribble/Sketch — по скетчу генерирует изображения
Про CONTROLNET
https://huggingface.co/lllyasviel/ControlNet-v1-1/tree/main
Промты
Кот в шапке санты
cat in santa hat, (((ink))), ((((grayscale)))),
Негативные промты
1. lowres, bad anatomy, bad hands, text, error, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, artist name 2. bad-artist, bad-hands-5, ugly, duplicate, censored, morbid, mutiliated, extra digits, bad hands, mutiliated hands, poorly drawn face, poorly drawn hands, mutation, deformed, blurry, bad anatomy, extra limbs, cloned face, gross proportions, malformed, missing arms, missing legs, mutated hands, low quality, lowres, normal quality, worst quality, standard quality, watermark, jpeg artifacts, weird eyes, plain background 3. easynegative, (worst quality, low quality:1.4), watermark, logo, bad anatomy, extra fingers, extra hands, body hair, mosaic 4. (worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed, underexposed, grayscale, bw, bad photo, bad photography, bad art:1.4), (watermark, signature, text font, username, error, logo, words, letters, digits, autograph, trademark, name:1.2), (blur, blurry, grainy), morbid, ugly, asymmetrical, mutated malformed, mutilated, poorly lit, bad shadow, draft, cropped, out of frame, cut off, censored, jpeg artifacts, out of focus, glitch, duplicate, (airbrushed, cartoon, anime, semi-realistic, cgi, render, blender, digital art, manga, amateur:1.3), (3D ,3D Game, 3D Game Scene, 3D Character:1.1), (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3)
Настройки
Семплер: DPM++ 2M Karras, Euler a (не естественная кожа у людей), UniPC (новый, потестить) Restore faces — снять галку GFG = 7 (4-12) (чем выше, тем больше деталей дорисовывается, большие значения — пережжённое и пластиковое изображение, на фотографиях ставить 4.5) Sampling steps = 28 Mimic CFG Scale — 6 (CFG Scale = 12, Clip skip = 1) Если без Mimic CFG — Clip skip = 2 User interface — Quicksettings list — sd_model_checkpoint,sd_vae,CLIP_stop_at_last_layers Face restoration (лучше отключать) Code former = 0.6 live preview = 10 Multiplier for extra networks = 0.7 Vae https://huggingface.co/stabilityai/sd-vae-ft-mse-original/tree/main
COMFYUI
https://github.com/comfyanonymous/ComfyUI?tab=readme-ov-file Обновить C:\ConfUI\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\update\update_comfyui.bat C:\ConfUI\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\update\update_comfyui_and_python_dependencies.bat Запуск C:\ConfUI\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\run_nvidia_gpu.bat Модели класть в: C:\ConfUI\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\models\checkpoints Чтобы ссылаться на модели: (Для скорости — хранить все модели на ссд) https://schinagl.priv.at/nt/hardlinkshellext/HardLinkShellExt_X64.exe ПКМ — Запомнить источник ссылки ПКМ — Поместить как… — Символическую ссылку Включить режим разработчика (чтобы был доступен save API): Шестерня — Enable Dev mode Options Чтобы «изменения» в нодах действовали сразу: Шестерня — Widget Value Control Mode — before Менеджер: https://github.com/ltdrdata/ComfyUI-Manager C:\ConfUI\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\custom_nodes в адресной строке — cmd git clone https://github.com/ltdrdata/ComfyUI-Manager.git Чтобы видеть какие ноды свои: Lite Graph - Node source badge mode Lite Graph - Node ID badge mode Мониторинг ресурсов: Crystools из менеджера или https://github.com/crystian/ComfyUI-Crystools Clone this repo into custom_modules: cd ComfyUI/custom_nodes git clone https://github.com/crystian/ComfyUI-Crystools.git cd ComfyUI-Crystools pip install -r requirements.txt Горячие клавиши: 2 ЛКМ — поиск по вставке ноды CTRL + B — деактивировать/активировать ноду CTRL + стрелка вверх\вниз — усилить\ослабить промт CTRL + SHIFT + V — вставить с добавленными связями Использовать 2 GPU: https://github.com/neuratech-ai/ComfyUI-MultiGPU C:\ConfUI\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\custom_nodes>git clone https://github.com/neuratech-ai/ComfyUI-MultiGPU.git Переключить на 2ю GPU: C:\ConfUI\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\comfy\cli_args.py parser.add_argument(«—cuda-device», type=int, default=1, metavar=»DEVICE_ID», help=»Set the id of the cuda device this instance will use.») Выражения лица онлайн: https://github.com/kijai/ComfyUI-LivePortraitKJ/tree/main/examples Controlnet: ComfyUI-Advanced-ControlNet ComfyUI’s ControlNet Auxiliary Preprocessors Скачать модели: https://huggingface.co/lllyasviel/ControlNet-v1-1/tree/main Поместить модели: ComfyUI\models\controlnet Для XL: lineart — https://huggingface.co/promeai/sdxl-controlnet-lineart-promeai/tree/main canny — https://huggingface.co/diffusers/controlnet-canny-sdxl-1.0/tree/main Скачать diffusion_pytorch_model.safetensors и переименовать в controlnet-canny-sdxl-1.0.safetensors Лоры: https://huggingface.co/stabilityai/control-lora/tree/main/control-LoRAs-rank256 IPadapter: ComfyUI_IPAdapter_plus Скачать модели: https://github.com/cubiq/ComfyUI_IPAdapter_plus/ Поместить модели: /ComfyUI/models/clip_vision /ComfyUI/models/ipadapter Blip: Скачать — https://huggingface.co/Rookiehan/BLIP/tree/main положить в ComfyUI\models\BLIP Обновить torch (если какой-то мод всё сломал): Из папки ComfyUI_windows_portable\python_embeded .\python.exe .\Scripts\pip.exe install —upgrade —force-reinstall torch torchvision torchaudio —index-url https://download.pytorch.org/whl/cu121 Florence (картинка в текст): https://huggingface.co/microsoft/Florence-2-base Ставить в C:\ConfUI\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\models\LLM git clone https://huggingface.co/microsoft/Florence-2-base Из https://huggingface.co/microsoft/Florence-2-base/tree/main скачиваем pytorch_model.bin и кладём в Florence-2-base Janus-Pro: В менеджере ComfyUI-Janus-Pro C:\ConfUI\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\custom_nodes\janus-pro -> запустить cmd -> pip install -r requirements.txt Скачать модель (7B) https://huggingface.co/deepseek-ai/Janus-Pro-7B/tree/main переместить всё в папку C:\ConfUI\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\models\Janus-Pro\Janus-Pro-7B
Flux
Для clip (декодирование промта) https://huggingface.co/comfyanonymous/flux_text_encoders/tree/main clip в C:\ConfUI\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\models\clip Модели https://huggingface.co/Kijai/flux-fp8/tree/main Кладём модель в C:\ConfUI\ComfyUI_windows_portable_nvidia\ComfyUI_windows_portable\ComfyUI\models\unet Для schnell оптимально 4 шага https://huggingface.co/black-forest-labs/FLUX.1-schnell/tree/main Для dev оптимально 30 шагов https://huggingface.co/black-forest-labs/FLUX.1-dev/tree/main Vae https://huggingface.co/black-forest-labs/FLUX.1-schnell/tree/main/vae https://huggingface.co/black-forest-labs/FLUX.1-dev/tree/main/vae Сжатая модель https://huggingface.co/city96/FLUX.1-dev-gguf/tree/main Энкодер (clip) для сжатой модели https://huggingface.co/city96/t5-v1_1-xxl-encoder-gguf/tree/main
Полезные ссылки
Текст обрамлённой картинкой https://ideogram.ai/ Скрытый в картинке текст https://replicable.art/learn/generate-images-with-hidden-text-using-stable-diffusion-and-controlnet Аналог chatGPT (US and UK) https://claude.ai/ Растровую в векторную графику https://vectorizer.ai/ Генератор скайбокса https://skybox.blockadelabs.com/ Варианты одного изображения https://imagevariations.com/ Генератор музыки https://app.songr.ai/ Топ-новости отобранные ии https://www.newsminimalist.com/ Топовые модели для сравнения https://yupp.ai/
Нарисуй обложку для статей по "Postgresql" как скетч с цветными зарисовками в разрешении 1:1
Текст на обложку не добавляй.
На белом фоне. Минимальные отступы от изображения по бокам.
Комментарии
Комментариев пока нет.