Skip to content
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

"RuntimeError: Found at least two devices" #10

Closed
tailgunnerx opened this issue Feb 8, 2024 · 68 comments
Closed

"RuntimeError: Found at least two devices" #10

tailgunnerx opened this issue Feb 8, 2024 · 68 comments
Assignees
Labels
bug Something isn't working

Comments

@tailgunnerx
Copy link

When using PhotoMaker for the first time:

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!

Per ChatGPT4:

The error message indicates that there's a device mismatch between the tensors involved in the operation. Specifically, the error states:

vbnet

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!

This means that part of your computation is happening on the GPU (cuda:0) and another part on the CPU, which is not allowed during tensor operations in PyTorch. All tensors involved in an operation must be on the same device.

To resolve this issue, ensure that all tensors and models involved in the computation are moved to the same device. You can explicitly move tensors to a device using .to(device) method where device is either "cpu" or a specific CUDA device like "cuda:0".

For example, if you have a tensor tensor and a model model, and you want to perform operations on the GPU, you can do:

python

device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
tensor = tensor.to(device)
model = model.to(device)

You should apply this to all tensors and models involved in the operations leading to the error. If some tensors are generated within a function or a library call, check the documentation for those functions or libraries to see if there's a way to specify the device for their internal computations.

In your specific case, it looks like the error is happening within the transformers library during the forward pass of a GPT-2 model. If you're using pre-built functions or classes from a library, ensure that the model and all input tensors are moved to the same device before calling such functions. If the library provides a way to set the device for its internal operations, make sure to use it.

@machineminded
Copy link
Owner

Does it give a stacktrace of this error?

@tailgunnerx
Copy link
Author

Does it give a stacktrace of this error?

not sure where to find this information

@machineminded
Copy link
Owner

machineminded commented Feb 8, 2024

Does it give a stacktrace of this error?

not sure where to find this information

Stack trace looks like this in python. I found a similar error with Fooocus on Reddit. What were you trying to do when this error was returned?

### more log entries occurred before this line

File "E:\FOOOCUS\Fooocus_win64_2-1-831\python_embeded\lib\site-packages\torch\nn\modules\[module.py](https://module.py/)", line 1518, in _wrapped_call_impl

return self._call_impl(*args, **kwargs)

File "E:\FOOOCUS\Fooocus_win64_2-1-831\python_embeded\lib\site-packages\torch\nn\modules\[module.py](https://module.py/)", line 1527, in _call_impl

return forward_call(*args, **kwargs)

File "E:\FOOOCUS\Fooocus_win64_2-1-831\python_embeded\lib\site-packages\transformers\models\gpt2\modeling_gpt2.py", line 332, in forward

attn_output, attn_weights = self._attn(query, key, value, attention_mask, head_mask)

File "E:\FOOOCUS\Fooocus_win64_2-1-831\python_embeded\lib\site-packages\transformers\models\gpt2\modeling_gpt2.py", line 203, in _attn

attn_weights = torch.where(causal_mask, attn_weights.to(attn_weights.dtype), mask_value)

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!

@machineminded
Copy link
Owner

I noticed that I'm not getting this error if I run launch.py from cmd. What would be the difference vs. executing launch.py by clicking on it?

I think the difference would be that one is using the virtual environment venv and the other would be using the python environment on your system. If your system environment is working then that is okay too. Do you have other UIs installed like AUTOMATIC1111 or ComfyUI?

@tailgunnerx
Copy link
Author

I noticed that I'm not getting this error if I run launch.py from cmd. What would be the difference vs. executing launch.py by clicking on it?

I think the difference would be that one is using the virtual environment venv and the other would be using the python environment on your system. If your system environment is working then that is okay too. Do you have other UIs installed like AUTOMATIC1111 or ComfyUI?

actually I just got the error running from cmd so I take that back lol. I think it's more of a time between starting a fresh execution and it idling.

@tailgunnerx
Copy link
Author

I noticed that I'm not getting this error if I run launch.py from cmd. What would be the difference vs. executing launch.py by clicking on it?

I think the difference would be that one is using the virtual environment venv and the other would be using the python environment on your system. If your system environment is working then that is okay too. Do you have other UIs installed like AUTOMATIC1111 or ComfyUI?

Yeah I have A1 for 1.5 but not running it atm.

@machineminded
Copy link
Owner

What operation within Fooocus causes the error from the OP?

@tailgunnerx
Copy link
Author

What operation within Fooocus causes the error from the OP?

seems like it's all the functions that generate an image.

@machineminded
Copy link
Owner

After activating the venv with .\venv\Scripts\activate, and running pip show torch torchvision what is the output?

@tailgunnerx
Copy link
Author

tailgunnerx commented Feb 8, 2024

After activating the venv with .\venv\Scripts\activate, and running pip show torch torchvision what is the output?

(venv) C:\Fooocus-inswapper-main>pip show torch torchvision
Name: torch
Version: 2.2.0+cu118
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org/
Author: PyTorch Team
Author-email: [email protected]
License: BSD-3
Location: c:\fooocus-inswapper-main\venv\lib\site-packages
Requires: filelock, fsspec, jinja2, networkx, sympy, typing-extensions
Required-by: accelerate, basicsr, lpips, peft, pytorch-lightning, timm, torchaudio, torchmetrics, torchsde, torchvision
---
Name: torchvision
Version: 0.17.0+cu118
Summary: image and video datasets and models for torch deep learning
Home-page: https://github.com/pytorch/vision
Author: PyTorch Core Team
Author-email: [email protected]
License: BSD
Location: c:\fooocus-inswapper-main\venv\lib\site-packages
Requires: numpy, pillow, requests, torch
Required-by: basicsr, lpips, timm

@machineminded
Copy link
Owner

machineminded commented Feb 8, 2024

Can you post the full output from when the error occurs? Also, does it ever happen when starting, or only during image generation? I see a similar issue on the main repo here.

@tailgunnerx
Copy link
Author

Errors seem to fluctuate, this is running inswapper on 0.

Microsoft Windows [Version 10.0.19045.3930]
(c) Microsoft Corporation. All rights reserved.

C:\Windows\System32>cd C:\Fooocus-inswapper-main

C:\Fooocus-inswapper-main>python launch.py
[System ARGV] ['launch.py']
You do not have [juggernautXL_v8Rundiffusion.safetensors] but you have [juggernautXL_version6Rundiffusion.safetensors].
Fooocus will use [juggernautXL_version6Rundiffusion.safetensors] to avoid downloading new models, but you are not using latest models.
Use --always-download-new-model to avoid fallback and always get new models.
Total VRAM 12282 MB, total RAM 32549 MB
Set vram state to: NORMAL_VRAM
Always offload VRAM
Device: cuda:0 NVIDIA GeForce RTX 4070 : native
VAE dtype: torch.bfloat16
Using pytorch cross attention
C:\Python310\lib\site-packages\diffusers\utils\outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
  torch.utils._pytree._register_pytree_node(
Refiner unloaded.
C:\Python310\lib\site-packages\diffusers\utils\outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
  torch.utils._pytree._register_pytree_node(
model_type EPS
UNet ADM Dimension 2816
Using pytorch attention in VAE
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
Using pytorch attention in VAE
extra {'cond_stage_model.clip_l.text_projection', 'cond_stage_model.clip_l.logit_scale'}
left over keys: dict_keys(['cond_stage_model.clip_l.transformer.text_model.embeddings.position_ids'])
Base model loaded: C:\Fooocus-inswapper-main\models\checkpoints\juggernautXL_version6Rundiffusion.safetensors
Request to load LoRAs [['sd_xl_offset_example-lora_1.0.safetensors', 0.1], ['None', 1.0], ['None', 1.0], ['None', 1.0], ['None', 1.0]] for model [C:\Fooocus-inswapper-main\models\checkpoints\juggernautXL_version6Rundiffusion.safetensors].
Loaded LoRA [C:\Fooocus-inswapper-main\models\loras\sd_xl_offset_example-lora_1.0.safetensors] for UNet [C:\Fooocus-inswapper-main\models\checkpoints\juggernautXL_version6Rundiffusion.safetensors] with 788 keys at weight 0.1.
Fooocus V2 Expansion: Vocab with 642 words.
Fooocus Expansion engine loaded for cuda:0, use_fp16 = True.
Requested to load SDXLClipModel
Requested to load GPT2LMHeadModel
Loading 2 new models
[Fooocus Model Management] Moving model(s) has taken 0.30 seconds
'Blocks' object has no attribute 'server_name'
Running on local URL:  http://127.0.0.1:7865

To create a public link, set `share=True` in `launch()`.
Inswapper: ENABLED
PhotoMaker: DISABLED
[Parameters] Adaptive CFG = 7
[Parameters] Sharpness = 2
[Parameters] ADM Scale = 1.5 : 0.8 : 0.3
[Parameters] CFG = 4.0
[Parameters] Seed = 4033774592796129292
[Parameters] Sampler = dpmpp_2m_sde_gpu - karras
[Parameters] Steps = 30 - 15
[Fooocus] Initializing ...
[Fooocus] Loading models ...
Refiner unloaded.
[Fooocus] Processing prompts ...
[Fooocus] Preparing Fooocus text #1 ...
[Prompt Expansion] 30 year old woman, cyberpunk, detailed deep bright pretty perfect cute sharp focus, beautiful intricate, elegant, highly inspired, extremely creative, color spread, very inspirational, innocent, light, magical, artistic, vibrant, symmetry, fine, hopeful, epic, cinematic, positive, pure, best, full, cheerful, thought, iconic, lovely, joyful, unique, awesome
[Fooocus] Preparing Fooocus text #2 ...
[Prompt Expansion] 30 year old woman, cyberpunk, intricate, elegant, highly detailed, extremely beautiful, glowing, sharp focus, symmetry, fine detail, inspired whole background, epic composition, colorful, polished, complex, amazing dynamic dramatic cinematic color, lovely colors, cute, wonderful atmosphere, professional, stunning, creative, positive, cheerful, unique, cool, best, winning, perfect
[Fooocus] Encoding positive #1 ...
[Fooocus Model Management] Moving model(s) has taken 0.12 seconds
[Fooocus] Encoding positive #2 ...
[Fooocus] Encoding negative #1 ...
[Fooocus] Encoding negative #2 ...
[Parameters] Denoising Strength = 1.0
[Parameters] Initial Latent shape: Image Space (896, 1152)
Preparation time: 1.74 seconds
[Sampler] refiner_swap_method = joint
[Sampler] sigma_min = 0.0291671771556139, sigma_max = 14.614643096923828
Requested to load SDXL
Loading 1 new model
[Fooocus Model Management] Moving model(s) has taken 1.44 seconds
  0%|                                                                                           | 0/30 [00:00<?, ?it/s]C:\Fooocus-inswapper-main\ldm_patched\ldm\modules\attention.py:325: UserWarning: 1Torch was not compiled with flash attention. (Triggered internally at ..\aten\src\ATen\native\transformers\cuda\sdp_utils.cpp:263.)
  out = torch.nn.functional.scaled_dot_product_attention(q, k, v, attn_mask=mask, dropout_p=0.0, is_causal=False)
100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [00:10<00:00,  2.78it/s]
Requested to load AutoencoderKL
Loading 1 new model
[Fooocus Model Management] Moving model(s) has taken 0.13 seconds
Inswapper: Target index: 0.0
Applied providers: ['AzureExecutionProvider', 'CPUExecutionProvider'], with options: {'AzureExecutionProvider': {}, 'CPUExecutionProvider': {}}
find model: ./checkpoints\models\buffalo_l\1k3d68.onnx landmark_3d_68 ['None', 3, 192, 192] 0.0 1.0
Applied providers: ['AzureExecutionProvider', 'CPUExecutionProvider'], with options: {'AzureExecutionProvider': {}, 'CPUExecutionProvider': {}}
find model: ./checkpoints\models\buffalo_l\2d106det.onnx landmark_2d_106 ['None', 3, 192, 192] 0.0 1.0
Applied providers: ['AzureExecutionProvider', 'CPUExecutionProvider'], with options: {'AzureExecutionProvider': {}, 'CPUExecutionProvider': {}}
find model: ./checkpoints\models\buffalo_l\det_10g.onnx detection [1, 3, '?', '?'] 127.5 128.0
Applied providers: ['AzureExecutionProvider', 'CPUExecutionProvider'], with options: {'AzureExecutionProvider': {}, 'CPUExecutionProvider': {}}
find model: ./checkpoints\models\buffalo_l\genderage.onnx genderage ['None', 3, 96, 96] 0.0 1.0
Applied providers: ['AzureExecutionProvider', 'CPUExecutionProvider'], with options: {'AzureExecutionProvider': {}, 'CPUExecutionProvider': {}}
find model: ./checkpoints\models\buffalo_l\w600k_r50.onnx recognition ['None', 3, 112, 112] 127.5 127.5
set det-size: (320, 320)
C:\Python310\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py:69: UserWarning: Specified provider 'CUDAExecutionProvider' is not in available provider names.Available providers: 'AzureExecutionProvider, CPUExecutionProvider'
  warnings.warn(
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
inswapper-shape: [1, 3, 128, 128]
C:\Python310\lib\site-packages\insightface\utils\transform.py:68: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.
To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.
  P = np.linalg.lstsq(X_homo, Y)[0].T # Affine matrix. 3 x 4
Replacing faces in target image from the left to the right by order
Traceback (most recent call last):
  File "C:\Fooocus-inswapper-main\modules\async_worker.py", line 860, in worker
    handler(task)
  File "C:\Python310\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "C:\Python310\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "C:\Fooocus-inswapper-main\modules\async_worker.py", line 812, in handler
    imgs = perform_face_swap(imgs, inswapper_source_image, inswapper_target_image_index)
  File "C:\Fooocus-inswapper-main\modules\face_swap.py", line 17, in perform_face_swap
    from inswapper.restoration import face_restoration,check_ckpts,set_realesrgan,torch,ARCH_REGISTRY,cv2
  File "C:\Fooocus-inswapper-main\inswapper\restoration.py", line 10, in <module>
    from basicsr.utils import imwrite, img2tensor, tensor2img
ModuleNotFoundError: No module named 'basicsr'
Total time: 17.66 seconds

@machineminded
Copy link
Owner

This is a different error. It says basicsr is not found. Please run

xcopy /E /I /Y inswapper\CodeFormer\CodeFormer\basicsr venv\Lib\site-packages\basicsr
xcopy /E /I /Y inswapper\CodeFormer\CodeFormer\facelib venv\Lib\site-packages\facelib

from the same directory where launch.py is located.

@tailgunnerx
Copy link
Author

xcopy /E /I /Y inswapper\CodeFormer\CodeFormer\basicsr venv\Lib\site-packages\basicsr
xcopy /E /I /Y inswapper\CodeFormer\CodeFormer\facelib venv\Lib\site-packages\facelib

just to be consistent, how many files are copying for you when you run these?

basicsr = 50 files copied
facelib = 28 files copied

@tailgunnerx
Copy link
Author

This is a different error. It says basicsr is not found. Please run

xcopy /E /I /Y inswapper\CodeFormer\CodeFormer\basicsr venv\Lib\site-packages\basicsr
xcopy /E /I /Y inswapper\CodeFormer\CodeFormer\facelib venv\Lib\site-packages\facelib

from the same directory where launch.py is located.

Microsoft Windows [Version 10.0.19045.3930]
(c) Microsoft Corporation. All rights reserved.

C:\Windows\System32>cd C:\Fooocus-inswapper-main

C:\Fooocus-inswapper-main>xcopy /E /I /Y inswapper\CodeFormer\CodeFormer\basicsr venv\Lib\site-packages\basicsr
inswapper\CodeFormer\CodeFormer\basicsr\setup.py
inswapper\CodeFormer\CodeFormer\basicsr\train.py
inswapper\CodeFormer\CodeFormer\basicsr\VERSION
inswapper\CodeFormer\CodeFormer\basicsr\version.py
inswapper\CodeFormer\CodeFormer\basicsr\__init__.py
inswapper\CodeFormer\CodeFormer\basicsr\archs\arcface_arch.py
inswapper\CodeFormer\CodeFormer\basicsr\archs\arch_util.py
inswapper\CodeFormer\CodeFormer\basicsr\archs\codeformer_arch.py
inswapper\CodeFormer\CodeFormer\basicsr\archs\rrdbnet_arch.py
inswapper\CodeFormer\CodeFormer\basicsr\archs\vgg_arch.py
inswapper\CodeFormer\CodeFormer\basicsr\archs\vqgan_arch.py
inswapper\CodeFormer\CodeFormer\basicsr\archs\__init__.py
inswapper\CodeFormer\CodeFormer\basicsr\data\data_sampler.py
inswapper\CodeFormer\CodeFormer\basicsr\data\data_util.py
inswapper\CodeFormer\CodeFormer\basicsr\data\prefetch_dataloader.py
inswapper\CodeFormer\CodeFormer\basicsr\data\transforms.py
inswapper\CodeFormer\CodeFormer\basicsr\data\__init__.py
inswapper\CodeFormer\CodeFormer\basicsr\losses\losses.py
inswapper\CodeFormer\CodeFormer\basicsr\losses\loss_util.py
inswapper\CodeFormer\CodeFormer\basicsr\losses\__init__.py
inswapper\CodeFormer\CodeFormer\basicsr\metrics\metric_util.py
inswapper\CodeFormer\CodeFormer\basicsr\metrics\psnr_ssim.py
inswapper\CodeFormer\CodeFormer\basicsr\metrics\__init__.py
inswapper\CodeFormer\CodeFormer\basicsr\models\__init__.py
inswapper\CodeFormer\CodeFormer\basicsr\ops\__init__.py
inswapper\CodeFormer\CodeFormer\basicsr\ops\dcn\deform_conv.py
inswapper\CodeFormer\CodeFormer\basicsr\ops\dcn\__init__.py
inswapper\CodeFormer\CodeFormer\basicsr\ops\dcn\src\deform_conv_cuda.cpp
inswapper\CodeFormer\CodeFormer\basicsr\ops\dcn\src\deform_conv_cuda_kernel.cu
inswapper\CodeFormer\CodeFormer\basicsr\ops\dcn\src\deform_conv_ext.cpp
inswapper\CodeFormer\CodeFormer\basicsr\ops\fused_act\fused_act.py
inswapper\CodeFormer\CodeFormer\basicsr\ops\fused_act\__init__.py
inswapper\CodeFormer\CodeFormer\basicsr\ops\fused_act\src\fused_bias_act.cpp
inswapper\CodeFormer\CodeFormer\basicsr\ops\fused_act\src\fused_bias_act_kernel.cu
inswapper\CodeFormer\CodeFormer\basicsr\ops\upfirdn2d\upfirdn2d.py
inswapper\CodeFormer\CodeFormer\basicsr\ops\upfirdn2d\__init__.py
inswapper\CodeFormer\CodeFormer\basicsr\ops\upfirdn2d\src\upfirdn2d.cpp
inswapper\CodeFormer\CodeFormer\basicsr\ops\upfirdn2d\src\upfirdn2d_kernel.cu
inswapper\CodeFormer\CodeFormer\basicsr\utils\dist_util.py
inswapper\CodeFormer\CodeFormer\basicsr\utils\download_util.py
inswapper\CodeFormer\CodeFormer\basicsr\utils\file_client.py
inswapper\CodeFormer\CodeFormer\basicsr\utils\img_util.py
inswapper\CodeFormer\CodeFormer\basicsr\utils\lmdb_util.py
inswapper\CodeFormer\CodeFormer\basicsr\utils\logger.py
inswapper\CodeFormer\CodeFormer\basicsr\utils\matlab_functions.py
inswapper\CodeFormer\CodeFormer\basicsr\utils\misc.py
inswapper\CodeFormer\CodeFormer\basicsr\utils\options.py
inswapper\CodeFormer\CodeFormer\basicsr\utils\realesrgan_utils.py
inswapper\CodeFormer\CodeFormer\basicsr\utils\registry.py
inswapper\CodeFormer\CodeFormer\basicsr\utils\__init__.py
50 File(s) copied
C:\Fooocus-inswapper-main>xcopy /E /I /Y inswapper\CodeFormer\CodeFormer\facelib venv\Lib\site-packages\facelib
inswapper\CodeFormer\CodeFormer\facelib\detection\align_trans.py
inswapper\CodeFormer\CodeFormer\facelib\detection\matlab_cp2tform.py
inswapper\CodeFormer\CodeFormer\facelib\detection\__init__.py
inswapper\CodeFormer\CodeFormer\facelib\detection\retinaface\retinaface.py
inswapper\CodeFormer\CodeFormer\facelib\detection\retinaface\retinaface_net.py
inswapper\CodeFormer\CodeFormer\facelib\detection\retinaface\retinaface_utils.py
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\face_detector.py
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\__init__.py
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\models\common.py
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\models\experimental.py
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\models\yolo.py
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\models\yolov5l.yaml
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\models\yolov5n.yaml
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\models\__init__.py
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\utils\autoanchor.py
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\utils\datasets.py
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\utils\extract_ckpt.py
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\utils\general.py
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\utils\torch_utils.py
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\utils\__init__.py
inswapper\CodeFormer\CodeFormer\facelib\parsing\bisenet.py
inswapper\CodeFormer\CodeFormer\facelib\parsing\parsenet.py
inswapper\CodeFormer\CodeFormer\facelib\parsing\resnet.py
inswapper\CodeFormer\CodeFormer\facelib\parsing\__init__.py
inswapper\CodeFormer\CodeFormer\facelib\utils\face_restoration_helper.py
inswapper\CodeFormer\CodeFormer\facelib\utils\face_utils.py
inswapper\CodeFormer\CodeFormer\facelib\utils\misc.py
inswapper\CodeFormer\CodeFormer\facelib\utils\__init__.py
28 File(s) copied
C:\Fooocus-inswapper-main>python launch.py
[System ARGV] ['launch.py']
You do not have [juggernautXL_v8Rundiffusion.safetensors] but you have [juggernautXL_version6Rundiffusion.safetensors].
Fooocus will use [juggernautXL_version6Rundiffusion.safetensors] to avoid downloading new models, but you are not using latest models.
Use --always-download-new-model to avoid fallback and always get new models.
Total VRAM 12282 MB, total RAM 32549 MB
Set vram state to: NORMAL_VRAM
Always offload VRAM
Device: cuda:0 NVIDIA GeForce RTX 4070 : native
VAE dtype: torch.bfloat16
Using pytorch cross attention
C:\Python310\lib\site-packages\diffusers\utils\outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
  torch.utils._pytree._register_pytree_node(
Refiner unloaded.
C:\Python310\lib\site-packages\diffusers\utils\outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
  torch.utils._pytree._register_pytree_node(
model_type EPS
UNet ADM Dimension 2816
Using pytorch attention in VAE
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
Using pytorch attention in VAE
extra {'cond_stage_model.clip_l.logit_scale', 'cond_stage_model.clip_l.text_projection'}
left over keys: dict_keys(['cond_stage_model.clip_l.transformer.text_model.embeddings.position_ids'])
Base model loaded: C:\Fooocus-inswapper-main\models\checkpoints\juggernautXL_version6Rundiffusion.safetensors
Request to load LoRAs [['sd_xl_offset_example-lora_1.0.safetensors', 0.1], ['None', 1.0], ['None', 1.0], ['None', 1.0], ['None', 1.0]] for model [C:\Fooocus-inswapper-main\models\checkpoints\juggernautXL_version6Rundiffusion.safetensors].
Loaded LoRA [C:\Fooocus-inswapper-main\models\loras\sd_xl_offset_example-lora_1.0.safetensors] for UNet [C:\Fooocus-inswapper-main\models\checkpoints\juggernautXL_version6Rundiffusion.safetensors] with 788 keys at weight 0.1.
Fooocus V2 Expansion: Vocab with 642 words.
Fooocus Expansion engine loaded for cuda:0, use_fp16 = True.
Requested to load SDXLClipModel
Requested to load GPT2LMHeadModel
Loading 2 new models
[Fooocus Model Management] Moving model(s) has taken 0.24 seconds
Running on local URL:  http://127.0.0.1:7865
App started successful. Use the app with http://127.0.0.1:7865/ or 127.0.0.1:7865

To create a public link, set `share=True` in `launch()`.
Inswapper: ENABLED
PhotoMaker: DISABLED
[Parameters] Adaptive CFG = 7
[Parameters] Sharpness = 2
[Parameters] ADM Scale = 1.5 : 0.8 : 0.3
[Parameters] CFG = 4.0
[Parameters] Seed = 3604631258951612005
[Parameters] Sampler = dpmpp_2m_sde_gpu - karras
[Parameters] Steps = 30 - 15
[Fooocus] Initializing ...
[Fooocus] Loading models ...
Refiner unloaded.
[Fooocus] Processing prompts ...
[Fooocus] Preparing Fooocus text #1 ...
[Prompt Expansion] 30 year old woman, cyberpunk game, gorgeous, amazing, elegant, intricate, highly detailed, dynamic light, great composition, atmosphere, fancy, cinematic, artistic, fine detail, pretty, perfect, colorful, sharp focus, winning, grand illumination, radiant, professional, best, creative, positive, thought, imagined, magic, dramatic, pure, coherent, cute
[Fooocus] Preparing Fooocus text #2 ...
[Prompt Expansion] 30 year old woman, cyberpunk game, cute, expressive detailed perfect royal elegant pretty, background light, ambient dynamic dramatic cinematic color, gorgeous atmosphere, sharp focus, fair composition, adventurous, lively, intricate, highly detail, beautiful, inspired, professional, winning, artistic, charismatic, thought best, inspirational, marvelous, fabulous, epic, singular, glorious, cool, vivid
[Fooocus] Encoding positive #1 ...
[Fooocus Model Management] Moving model(s) has taken 0.16 seconds
[Fooocus] Encoding positive #2 ...
[Fooocus] Encoding negative #1 ...
[Fooocus] Encoding negative #2 ...
[Parameters] Denoising Strength = 1.0
[Parameters] Initial Latent shape: Image Space (896, 1152)
Preparation time: 1.80 seconds
[Sampler] refiner_swap_method = joint
[Sampler] sigma_min = 0.0291671771556139, sigma_max = 14.614643096923828
Requested to load SDXL
Loading 1 new model
[Fooocus Model Management] Moving model(s) has taken 1.48 seconds
  0%|                                                                                           | 0/30 [00:00<?, ?it/s]C:\Fooocus-inswapper-main\ldm_patched\ldm\modules\attention.py:325: UserWarning: 1Torch was not compiled with flash attention. (Triggered internally at ..\aten\src\ATen\native\transformers\cuda\sdp_utils.cpp:263.)
  out = torch.nn.functional.scaled_dot_product_attention(q, k, v, attn_mask=mask, dropout_p=0.0, is_causal=False)
100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [00:10<00:00,  2.84it/s]
Requested to load AutoencoderKL
Loading 1 new model
[Fooocus Model Management] Moving model(s) has taken 0.10 seconds
Inswapper: Target index: 0.0
Applied providers: ['AzureExecutionProvider', 'CPUExecutionProvider'], with options: {'AzureExecutionProvider': {}, 'CPUExecutionProvider': {}}
find model: ./checkpoints\models\buffalo_l\1k3d68.onnx landmark_3d_68 ['None', 3, 192, 192] 0.0 1.0
Applied providers: ['AzureExecutionProvider', 'CPUExecutionProvider'], with options: {'AzureExecutionProvider': {}, 'CPUExecutionProvider': {}}
find model: ./checkpoints\models\buffalo_l\2d106det.onnx landmark_2d_106 ['None', 3, 192, 192] 0.0 1.0
Applied providers: ['AzureExecutionProvider', 'CPUExecutionProvider'], with options: {'AzureExecutionProvider': {}, 'CPUExecutionProvider': {}}
find model: ./checkpoints\models\buffalo_l\det_10g.onnx detection [1, 3, '?', '?'] 127.5 128.0
Applied providers: ['AzureExecutionProvider', 'CPUExecutionProvider'], with options: {'AzureExecutionProvider': {}, 'CPUExecutionProvider': {}}
find model: ./checkpoints\models\buffalo_l\genderage.onnx genderage ['None', 3, 96, 96] 0.0 1.0
Applied providers: ['AzureExecutionProvider', 'CPUExecutionProvider'], with options: {'AzureExecutionProvider': {}, 'CPUExecutionProvider': {}}
find model: ./checkpoints\models\buffalo_l\w600k_r50.onnx recognition ['None', 3, 112, 112] 127.5 127.5
set det-size: (320, 320)
C:\Python310\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py:69: UserWarning: Specified provider 'CUDAExecutionProvider' is not in available provider names.Available providers: 'AzureExecutionProvider, CPUExecutionProvider'
  warnings.warn(
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
inswapper-shape: [1, 3, 128, 128]
C:\Python310\lib\site-packages\insightface\utils\transform.py:68: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.
To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.
  P = np.linalg.lstsq(X_homo, Y)[0].T # Affine matrix. 3 x 4
Replacing faces in target image from the left to the right by order
Traceback (most recent call last):
  File "C:\Fooocus-inswapper-main\modules\async_worker.py", line 860, in worker
    handler(task)
  File "C:\Python310\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "C:\Python310\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "C:\Fooocus-inswapper-main\modules\async_worker.py", line 812, in handler
    imgs = perform_face_swap(imgs, inswapper_source_image, inswapper_target_image_index)
  File "C:\Fooocus-inswapper-main\modules\face_swap.py", line 17, in perform_face_swap
    from inswapper.restoration import face_restoration,check_ckpts,set_realesrgan,torch,ARCH_REGISTRY,cv2
  File "C:\Fooocus-inswapper-main\inswapper\restoration.py", line 10, in <module>
    from basicsr.utils import imwrite, img2tensor, tensor2img
ModuleNotFoundError: No module named 'basicsr'
Total time: 17.53 seconds

@machineminded
Copy link
Owner

It looks like you are running it outside of the venv. If you activate the venv and run what error do you get?

@tailgunnerx
Copy link
Author

It looks like you are running it outside of the venv. If you activate the venv and run what error do you get?


Microsoft Windows [Version 10.0.19045.3930]
(c) Microsoft Corporation. All rights reserved.

C:\Windows\System32>cd C:\Fooocus-inswapper-main

C:\Fooocus-inswapper-main>.\venv\Scripts\activate

(venv) C:\Fooocus-inswapper-main>xcopy /E /I /Y inswapper\CodeFormer\CodeFormer\basicsr venv\Lib\site-packages\basicsr
inswapper\CodeFormer\CodeFormer\basicsr\setup.py
inswapper\CodeFormer\CodeFormer\basicsr\train.py
inswapper\CodeFormer\CodeFormer\basicsr\VERSION
inswapper\CodeFormer\CodeFormer\basicsr\version.py
inswapper\CodeFormer\CodeFormer\basicsr\__init__.py
inswapper\CodeFormer\CodeFormer\basicsr\archs\arcface_arch.py
inswapper\CodeFormer\CodeFormer\basicsr\archs\arch_util.py
inswapper\CodeFormer\CodeFormer\basicsr\archs\codeformer_arch.py
inswapper\CodeFormer\CodeFormer\basicsr\archs\rrdbnet_arch.py
inswapper\CodeFormer\CodeFormer\basicsr\archs\vgg_arch.py
inswapper\CodeFormer\CodeFormer\basicsr\archs\vqgan_arch.py
inswapper\CodeFormer\CodeFormer\basicsr\archs\__init__.py
inswapper\CodeFormer\CodeFormer\basicsr\data\data_sampler.py
inswapper\CodeFormer\CodeFormer\basicsr\data\data_util.py
inswapper\CodeFormer\CodeFormer\basicsr\data\prefetch_dataloader.py
inswapper\CodeFormer\CodeFormer\basicsr\data\transforms.py
inswapper\CodeFormer\CodeFormer\basicsr\data\__init__.py
inswapper\CodeFormer\CodeFormer\basicsr\losses\losses.py
inswapper\CodeFormer\CodeFormer\basicsr\losses\loss_util.py
inswapper\CodeFormer\CodeFormer\basicsr\losses\__init__.py
inswapper\CodeFormer\CodeFormer\basicsr\metrics\metric_util.py
inswapper\CodeFormer\CodeFormer\basicsr\metrics\psnr_ssim.py
inswapper\CodeFormer\CodeFormer\basicsr\metrics\__init__.py
inswapper\CodeFormer\CodeFormer\basicsr\models\__init__.py
inswapper\CodeFormer\CodeFormer\basicsr\ops\__init__.py
inswapper\CodeFormer\CodeFormer\basicsr\ops\dcn\deform_conv.py
inswapper\CodeFormer\CodeFormer\basicsr\ops\dcn\__init__.py
inswapper\CodeFormer\CodeFormer\basicsr\ops\dcn\src\deform_conv_cuda.cpp
inswapper\CodeFormer\CodeFormer\basicsr\ops\dcn\src\deform_conv_cuda_kernel.cu
inswapper\CodeFormer\CodeFormer\basicsr\ops\dcn\src\deform_conv_ext.cpp
inswapper\CodeFormer\CodeFormer\basicsr\ops\fused_act\fused_act.py
inswapper\CodeFormer\CodeFormer\basicsr\ops\fused_act\__init__.py
inswapper\CodeFormer\CodeFormer\basicsr\ops\fused_act\src\fused_bias_act.cpp
inswapper\CodeFormer\CodeFormer\basicsr\ops\fused_act\src\fused_bias_act_kernel.cu
inswapper\CodeFormer\CodeFormer\basicsr\ops\upfirdn2d\upfirdn2d.py
inswapper\CodeFormer\CodeFormer\basicsr\ops\upfirdn2d\__init__.py
inswapper\CodeFormer\CodeFormer\basicsr\ops\upfirdn2d\src\upfirdn2d.cpp
inswapper\CodeFormer\CodeFormer\basicsr\ops\upfirdn2d\src\upfirdn2d_kernel.cu
inswapper\CodeFormer\CodeFormer\basicsr\utils\dist_util.py
inswapper\CodeFormer\CodeFormer\basicsr\utils\download_util.py
inswapper\CodeFormer\CodeFormer\basicsr\utils\file_client.py
inswapper\CodeFormer\CodeFormer\basicsr\utils\img_util.py
inswapper\CodeFormer\CodeFormer\basicsr\utils\lmdb_util.py
inswapper\CodeFormer\CodeFormer\basicsr\utils\logger.py
inswapper\CodeFormer\CodeFormer\basicsr\utils\matlab_functions.py
inswapper\CodeFormer\CodeFormer\basicsr\utils\misc.py
inswapper\CodeFormer\CodeFormer\basicsr\utils\options.py
inswapper\CodeFormer\CodeFormer\basicsr\utils\realesrgan_utils.py
inswapper\CodeFormer\CodeFormer\basicsr\utils\registry.py
inswapper\CodeFormer\CodeFormer\basicsr\utils\__init__.py
50 File(s) copied

(venv) C:\Fooocus-inswapper-main>xcopy /E /I /Y inswapper\CodeFormer\CodeFormer\facelib venv\Lib\site-packages\facelib
inswapper\CodeFormer\CodeFormer\facelib\detection\align_trans.py
inswapper\CodeFormer\CodeFormer\facelib\detection\matlab_cp2tform.py
inswapper\CodeFormer\CodeFormer\facelib\detection\__init__.py
inswapper\CodeFormer\CodeFormer\facelib\detection\retinaface\retinaface.py
inswapper\CodeFormer\CodeFormer\facelib\detection\retinaface\retinaface_net.py
inswapper\CodeFormer\CodeFormer\facelib\detection\retinaface\retinaface_utils.py
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\face_detector.py
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\__init__.py
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\models\common.py
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\models\experimental.py
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\models\yolo.py
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\models\yolov5l.yaml
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\models\yolov5n.yaml
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\models\__init__.py
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\utils\autoanchor.py
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\utils\datasets.py
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\utils\extract_ckpt.py
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\utils\general.py
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\utils\torch_utils.py
inswapper\CodeFormer\CodeFormer\facelib\detection\yolov5face\utils\__init__.py
inswapper\CodeFormer\CodeFormer\facelib\parsing\bisenet.py
inswapper\CodeFormer\CodeFormer\facelib\parsing\parsenet.py
inswapper\CodeFormer\CodeFormer\facelib\parsing\resnet.py
inswapper\CodeFormer\CodeFormer\facelib\parsing\__init__.py
inswapper\CodeFormer\CodeFormer\facelib\utils\face_restoration_helper.py
inswapper\CodeFormer\CodeFormer\facelib\utils\face_utils.py
inswapper\CodeFormer\CodeFormer\facelib\utils\misc.py
inswapper\CodeFormer\CodeFormer\facelib\utils\__init__.py
28 File(s) copied

(venv) C:\Fooocus-inswapper-main>launch.py
[System ARGV] ['C:\\Fooocus-inswapper-main\\launch.py']
You do not have [juggernautXL_v8Rundiffusion.safetensors] but you have [juggernautXL_version6Rundiffusion.safetensors].
Fooocus will use [juggernautXL_version6Rundiffusion.safetensors] to avoid downloading new models, but you are not using latest models.
Use --always-download-new-model to avoid fallback and always get new models.
Total VRAM 12282 MB, total RAM 32549 MB
Set vram state to: NORMAL_VRAM
Always offload VRAM
Device: cuda:0 NVIDIA GeForce RTX 4070 : native
VAE dtype: torch.bfloat16
Using pytorch cross attention
C:\Fooocus-inswapper-main\venv\lib\site-packages\diffusers\utils\outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
  torch.utils._pytree._register_pytree_node(
C:\Fooocus-inswapper-main\venv\lib\site-packages\diffusers\utils\outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
  torch.utils._pytree._register_pytree_node(
C:\Fooocus-inswapper-main\venv\lib\site-packages\diffusers\utils\outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
  torch.utils._pytree._register_pytree_node(
Refiner unloaded.
model_type EPS
UNet ADM Dimension 2816
Using pytorch attention in VAE
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
Using pytorch attention in VAE
extra {'cond_stage_model.clip_l.text_projection', 'cond_stage_model.clip_l.logit_scale'}
left over keys: dict_keys(['cond_stage_model.clip_l.transformer.text_model.embeddings.position_ids'])
Base model loaded: C:\Fooocus-inswapper-main\models\checkpoints\juggernautXL_version6Rundiffusion.safetensors
Request to load LoRAs [['sd_xl_offset_example-lora_1.0.safetensors', 0.1], ['None', 1.0], ['None', 1.0], ['None', 1.0], ['None', 1.0]] for model [C:\Fooocus-inswapper-main\models\checkpoints\juggernautXL_version6Rundiffusion.safetensors].
Loaded LoRA [C:\Fooocus-inswapper-main\models\loras\sd_xl_offset_example-lora_1.0.safetensors] for UNet [C:\Fooocus-inswapper-main\models\checkpoints\juggernautXL_version6Rundiffusion.safetensors] with 788 keys at weight 0.1.
Fooocus V2 Expansion: Vocab with 642 words.
Fooocus Expansion engine loaded for cuda:0, use_fp16 = True.
Requested to load SDXLClipModel
Requested to load GPT2LMHeadModel
Loading 2 new models
[Fooocus Model Management] Moving model(s) has taken 0.25 seconds
Running on local URL:  http://127.0.0.1:7865

To create a public link, set `share=True` in `launch()`.
App started successful. Use the app with http://127.0.0.1:7865/ or 127.0.0.1:7865
Inswapper: ENABLED
PhotoMaker: DISABLED
[Parameters] Adaptive CFG = 7
[Parameters] Sharpness = 2
[Parameters] ADM Scale = 1.5 : 0.8 : 0.3
[Parameters] CFG = 4.0
[Parameters] Seed = 1078866180457242112
[Parameters] Sampler = dpmpp_2m_sde_gpu - karras
[Parameters] Steps = 30 - 15
[Fooocus] Initializing ...
[Fooocus] Loading models ...
Refiner unloaded.
[Fooocus] Processing prompts ...
[Fooocus] Preparing Fooocus text #1 ...
[Prompt Expansion] 30 year old woman, cyberpunk game, gorgeous, amazing, elegant, intricate, highly detailed, dynamic light, great composition, atmosphere, cinematic, sharp focus, winning, fine color, awesome, inspiring, creative, positive, vibrant, inspirational, beautiful, confident, pretty, attractive, deep background, professional, thought, best, unique, perfect, full, coherent
[Fooocus] Preparing Fooocus text #2 ...
[Prompt Expansion] 30 year old woman, cyberpunk game, gorgeous, amazing, elegant, intricate, highly detailed, dynamic light, great colors, beautiful, inspired, vibrant, deep aesthetic, very inspirational, glowing, attractive, original, full color, winning, fine detail, pretty, artistic, cool, creative, passionate, awesome, inspiring, illuminated, colorful, shiny, sharp, fantastic
[Fooocus] Encoding positive #1 ...
[Fooocus Model Management] Moving model(s) has taken 0.12 seconds
[Fooocus] Encoding positive #2 ...
[Fooocus] Encoding negative #1 ...
[Fooocus] Encoding negative #2 ...
[Parameters] Denoising Strength = 1.0
[Parameters] Initial Latent shape: Image Space (896, 1152)
Preparation time: 2.07 seconds
[Sampler] refiner_swap_method = joint
[Sampler] sigma_min = 0.0291671771556139, sigma_max = 14.614643096923828
Requested to load SDXL
Loading 1 new model
[Fooocus Model Management] Moving model(s) has taken 1.41 seconds
  0%|                                                                                                                                                                                                                                                             | 0/30 [00:00<?, ?it/s]C:\Fooocus-inswapper-main\ldm_patched\ldm\modules\attention.py:325: UserWarning: 1Torch was not compiled with flash attention. (Triggered internally at ..\aten\src\ATen\native\transformers\cuda\sdp_utils.cpp:263.)
  out = torch.nn.functional.scaled_dot_product_attention(q, k, v, attn_mask=mask, dropout_p=0.0, is_causal=False)
100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 30/30 [00:10<00:00,  2.80it/s]
Requested to load AutoencoderKL
Loading 1 new model
[Fooocus Model Management] Moving model(s) has taken 0.12 seconds
Inswapper: Target index: 0.0
Applied providers: ['AzureExecutionProvider', 'CPUExecutionProvider'], with options: {'AzureExecutionProvider': {}, 'CPUExecutionProvider': {}}
find model: ./checkpoints\models\buffalo_l\1k3d68.onnx landmark_3d_68 ['None', 3, 192, 192] 0.0 1.0
Applied providers: ['AzureExecutionProvider', 'CPUExecutionProvider'], with options: {'AzureExecutionProvider': {}, 'CPUExecutionProvider': {}}
find model: ./checkpoints\models\buffalo_l\2d106det.onnx landmark_2d_106 ['None', 3, 192, 192] 0.0 1.0
Applied providers: ['AzureExecutionProvider', 'CPUExecutionProvider'], with options: {'AzureExecutionProvider': {}, 'CPUExecutionProvider': {}}
find model: ./checkpoints\models\buffalo_l\det_10g.onnx detection [1, 3, '?', '?'] 127.5 128.0
Applied providers: ['AzureExecutionProvider', 'CPUExecutionProvider'], with options: {'AzureExecutionProvider': {}, 'CPUExecutionProvider': {}}
find model: ./checkpoints\models\buffalo_l\genderage.onnx genderage ['None', 3, 96, 96] 0.0 1.0
Applied providers: ['AzureExecutionProvider', 'CPUExecutionProvider'], with options: {'AzureExecutionProvider': {}, 'CPUExecutionProvider': {}}
find model: ./checkpoints\models\buffalo_l\w600k_r50.onnx recognition ['None', 3, 112, 112] 127.5 127.5
set det-size: (320, 320)
C:\Fooocus-inswapper-main\venv\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py:69: UserWarning: Specified provider 'CUDAExecutionProvider' is not in available provider names.Available providers: 'AzureExecutionProvider, CPUExecutionProvider'
  warnings.warn(
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
inswapper-shape: [1, 3, 128, 128]
C:\Fooocus-inswapper-main\venv\lib\site-packages\insightface\utils\transform.py:68: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.
To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.
  P = np.linalg.lstsq(X_homo, Y)[0].T # Affine matrix. 3 x 4
Replacing faces in target image from the left to the right by order
Traceback (most recent call last):
  File "C:\Fooocus-inswapper-main\modules\async_worker.py", line 860, in worker
    handler(task)
  File "C:\Fooocus-inswapper-main\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "C:\Fooocus-inswapper-main\venv\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "C:\Fooocus-inswapper-main\modules\async_worker.py", line 812, in handler
    imgs = perform_face_swap(imgs, inswapper_source_image, inswapper_target_image_index)
  File "C:\Fooocus-inswapper-main\modules\face_swap.py", line 17, in perform_face_swap
    from inswapper.restoration import face_restoration,check_ckpts,set_realesrgan,torch,ARCH_REGISTRY,cv2
  File "C:\Fooocus-inswapper-main\inswapper\restoration.py", line 10, in <module>
    from basicsr.utils import imwrite, img2tensor, tensor2img
  File "C:\Fooocus-inswapper-main\venv\lib\site-packages\basicsr\__init__.py", line 3, in <module>
    from .archs import *
  File "C:\Fooocus-inswapper-main\venv\lib\site-packages\basicsr\archs\__init__.py", line 16, in <module>
    _arch_modules = [importlib.import_module(f'basicsr.archs.{file_name}') for file_name in arch_filenames]
  File "C:\Fooocus-inswapper-main\venv\lib\site-packages\basicsr\archs\__init__.py", line 16, in <listcomp>
    _arch_modules = [importlib.import_module(f'basicsr.archs.{file_name}') for file_name in arch_filenames]
  File "C:\Python310\lib\importlib\__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "C:\Fooocus-inswapper-main\venv\lib\site-packages\basicsr\archs\discriminator_arch.py", line 90, in <module>
    @ARCH_REGISTRY.register(suffix='basicsr')
TypeError: Registry.register() got an unexpected keyword argument 'suffix'
Total time: 18.25 seconds

@machineminded
Copy link
Owner

Something I noticed is that it is using CPUExecutionProvider during the inswapper routine. What video card do you have?

@tailgunnerx
Copy link
Author

Something I noticed is that it is using CPUExecutionProvider during the inswapper routine. What video card do you have?

Gigabyte 4070

@machineminded
Copy link
Owner

machineminded commented Feb 8, 2024

With the venv activated, can you run a plain python command, and then type

import torch
torch.cuda.is_available()

@tailgunnerx
Copy link
Author

(venv) C:\Fooocus-inswapper-main>python
Python 3.10.10 (tags/v3.10.10:aad5f6a, Feb  7 2023, 17:20:36) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available()
True
>>>

@machineminded
Copy link
Owner

I want to force it to use the GPU. For some reason it seems Fooocus can't use or see the GPU. Can you try the --always-gpu flag?

https://github.com/lllyasviel/Fooocus?tab=readme-ov-file#all-cmd-flags

python launch.py --always-gpu

@tailgunnerx
Copy link
Author

tailgunnerx commented Feb 8, 2024

I want to force it to use the GPU. For some reason it seems Fooocus can't use or see the GPU. Can you try the --always-gpu flag?

https://github.com/lllyasviel/Fooocus?tab=readme-ov-file#all-cmd-flags

python launch.py --always-gpu

running it now. Noticing the first generation is running super slow 7s per it.

I feel like Fooocus sees the gpu but the secondary script doesn't maybe? because the first generation is usually fast and working then it switches to a different module?

@machineminded
Copy link
Owner

If you check your task manager resources tab, can you see GPU memory being allocated, and GPU processor being used during the generation?

@tailgunnerx
Copy link
Author

I want to force it to use the GPU. For some reason it seems Fooocus can't use or see the GPU. Can you try the --always-gpu flag?

https://github.com/lllyasviel/Fooocus?tab=readme-ov-file#all-cmd-flags

python launch.py --always-gpu

Microsoft Windows [Version 10.0.19045.3930]
(c) Microsoft Corporation. All rights reserved.

C:\Windows\System32>cd C:\Fooocus-inswapper-main

C:\Fooocus-inswapper-main>python launch.py --always-gpu
[System ARGV] ['launch.py', '--always-gpu']
You do not have [juggernautXL_v8Rundiffusion.safetensors] but you have [juggernautXL_version6Rundiffusion.safetensors].
Fooocus will use [juggernautXL_version6Rundiffusion.safetensors] to avoid downloading new models, but you are not using latest models.
Use --always-download-new-model to avoid fallback and always get new models.
Total VRAM 12282 MB, total RAM 32549 MB
Set vram state to: HIGH_VRAM
Always offload VRAM
Device: cuda:0 NVIDIA GeForce RTX 4070 : native
VAE dtype: torch.bfloat16
Using pytorch cross attention
C:\Python310\lib\site-packages\diffusers\utils\outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
  torch.utils._pytree._register_pytree_node(
Refiner unloaded.
C:\Python310\lib\site-packages\diffusers\utils\outputs.py:63: UserWarning: torch.utils._pytree._register_pytree_node is deprecated. Please use torch.utils._pytree.register_pytree_node instead.
  torch.utils._pytree._register_pytree_node(
model_type EPS
UNet ADM Dimension 2816
Using pytorch attention in VAE
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
Using pytorch attention in VAE
extra {'cond_stage_model.clip_l.text_projection', 'cond_stage_model.clip_l.logit_scale'}
left over keys: dict_keys(['cond_stage_model.clip_l.transformer.text_model.embeddings.position_ids'])
loaded straight to GPU
Requested to load SDXL
Loading 1 new model
[Fooocus Model Management] Moving model(s) has taken 0.12 seconds
Base model loaded: C:\Fooocus-inswapper-main\models\checkpoints\juggernautXL_version6Rundiffusion.safetensors
Request to load LoRAs [['sd_xl_offset_example-lora_1.0.safetensors', 0.1], ['None', 1.0], ['None', 1.0], ['None', 1.0], ['None', 1.0]] for model [C:\Fooocus-inswapper-main\models\checkpoints\juggernautXL_version6Rundiffusion.safetensors].
Loaded LoRA [C:\Fooocus-inswapper-main\models\loras\sd_xl_offset_example-lora_1.0.safetensors] for UNet [C:\Fooocus-inswapper-main\models\checkpoints\juggernautXL_version6Rundiffusion.safetensors] with 788 keys at weight 0.1.
Fooocus V2 Expansion: Vocab with 642 words.
Fooocus Expansion engine loaded for cuda:0, use_fp16 = True.
Requested to load SDXLClipModel
Requested to load GPT2LMHeadModel
Loading 2 new models
[Fooocus Model Management] Moving model(s) has taken 0.24 seconds
Running on local URL:  http://127.0.0.1:7865
App started successful. Use the app with http://127.0.0.1:7865/ or 127.0.0.1:7865

To create a public link, set `share=True` in `launch()`.
Inswapper: ENABLED
PhotoMaker: DISABLED
[Parameters] Adaptive CFG = 7
[Parameters] Sharpness = 2
[Parameters] ADM Scale = 1.5 : 0.8 : 0.3
[Parameters] CFG = 4.0
[Parameters] Seed = 984104948671436075
[Parameters] Sampler = dpmpp_2m_sde_gpu - karras
[Parameters] Steps = 30 - 15
[Fooocus] Initializing ...
[Fooocus] Loading models ...
Refiner unloaded.
[Fooocus] Processing prompts ...
[Fooocus] Preparing Fooocus text #1 ...
[Prompt Expansion] 30 year old woman, cyberpunk game, gorgeous, amazing, elegant, intricate, highly detailed, colorful, surreal, dramatic, sharp focus, beautiful light, epic, fine composition, complex, fantastic colors, very inspirational, wonderful atmosphere, professional, winning, perfect clear quality, hopeful, unique, artistic, positive, vibrant, attractive, cute, confident, pretty, glowing
[Fooocus] Preparing Fooocus text #2 ...
[Prompt Expansion] 30 year old woman, cyberpunk game, gorgeous, amazing, elegant, intricate, highly detailed, colorful, burning background, sharp focus, great composition, cinematic light, dynamic, appealing, shiny, beautiful, brilliant, singular, fantastic, creative, positive, hopeful, cute, determined, vibrant, inspirational, dramatic ambient, shining, illuminated, incredible, loving, attractive
[Fooocus] Encoding positive #1 ...
[Fooocus] Encoding positive #2 ...
[Fooocus] Encoding negative #1 ...
[Fooocus] Encoding negative #2 ...
[Parameters] Denoising Strength = 1.0
[Parameters] Initial Latent shape: Image Space (896, 1152)
Preparation time: 1.62 seconds
[Sampler] refiner_swap_method = joint
[Sampler] sigma_min = 0.0291671771556139, sigma_max = 14.614643096923828
Requested to load SDXL
Loading 1 new model
[Fooocus Model Management] Moving model(s) has taken 1.33 seconds
  0%|                                                                                           | 0/30 [00:00<?, ?it/s]C:\Fooocus-inswapper-main\ldm_patched\ldm\modules\attention.py:325: UserWarning: 1Torch was not compiled with flash attention. (Triggered internally at ..\aten\src\ATen\native\transformers\cuda\sdp_utils.cpp:263.)
  out = torch.nn.functional.scaled_dot_product_attention(q, k, v, attn_mask=mask, dropout_p=0.0, is_causal=False)
100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [03:29<00:00,  6.98s/it]
Requested to load AutoencoderKL
Loading 1 new model
[Fooocus Model Management] Moving model(s) has taken 0.16 seconds
Inswapper: Target index: 0.0
Applied providers: ['AzureExecutionProvider', 'CPUExecutionProvider'], with options: {'AzureExecutionProvider': {}, 'CPUExecutionProvider': {}}
find model: ./checkpoints\models\buffalo_l\1k3d68.onnx landmark_3d_68 ['None', 3, 192, 192] 0.0 1.0
Applied providers: ['AzureExecutionProvider', 'CPUExecutionProvider'], with options: {'AzureExecutionProvider': {}, 'CPUExecutionProvider': {}}
find model: ./checkpoints\models\buffalo_l\2d106det.onnx landmark_2d_106 ['None', 3, 192, 192] 0.0 1.0
Applied providers: ['AzureExecutionProvider', 'CPUExecutionProvider'], with options: {'AzureExecutionProvider': {}, 'CPUExecutionProvider': {}}
find model: ./checkpoints\models\buffalo_l\det_10g.onnx detection [1, 3, '?', '?'] 127.5 128.0
Applied providers: ['AzureExecutionProvider', 'CPUExecutionProvider'], with options: {'AzureExecutionProvider': {}, 'CPUExecutionProvider': {}}
find model: ./checkpoints\models\buffalo_l\genderage.onnx genderage ['None', 3, 96, 96] 0.0 1.0
Applied providers: ['AzureExecutionProvider', 'CPUExecutionProvider'], with options: {'AzureExecutionProvider': {}, 'CPUExecutionProvider': {}}
find model: ./checkpoints\models\buffalo_l\w600k_r50.onnx recognition ['None', 3, 112, 112] 127.5 127.5
set det-size: (320, 320)
C:\Python310\lib\site-packages\onnxruntime\capi\onnxruntime_inference_collection.py:69: UserWarning: Specified provider 'CUDAExecutionProvider' is not in available provider names.Available providers: 'AzureExecutionProvider, CPUExecutionProvider'
  warnings.warn(
Applied providers: ['CPUExecutionProvider'], with options: {'CPUExecutionProvider': {}}
inswapper-shape: [1, 3, 128, 128]
C:\Python310\lib\site-packages\insightface\utils\transform.py:68: FutureWarning: `rcond` parameter will change to the default of machine precision times ``max(M, N)`` where M and N are the input matrix dimensions.
To use the future default and silence this warning we advise to pass `rcond=None`, to keep using the old, explicitly pass `rcond=-1`.
  P = np.linalg.lstsq(X_homo, Y)[0].T # Affine matrix. 3 x 4
Replacing faces in target image from the left to the right by order
Traceback (most recent call last):
  File "C:\Fooocus-inswapper-main\modules\async_worker.py", line 860, in worker
    handler(task)
  File "C:\Python310\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "C:\Python310\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "C:\Fooocus-inswapper-main\modules\async_worker.py", line 812, in handler
    imgs = perform_face_swap(imgs, inswapper_source_image, inswapper_target_image_index)
  File "C:\Fooocus-inswapper-main\modules\face_swap.py", line 17, in perform_face_swap
    from inswapper.restoration import face_restoration,check_ckpts,set_realesrgan,torch,ARCH_REGISTRY,cv2
  File "C:\Fooocus-inswapper-main\inswapper\restoration.py", line 10, in <module>
    from basicsr.utils import imwrite, img2tensor, tensor2img
ModuleNotFoundError: No module named 'basicsr'
Total time: 216.17 seconds

@tailgunnerx
Copy link
Author

If you check your task manager resources tab, can you see GPU memory being allocated, and GPU processor being used during the generation?

It's deff hitting the GPU

@machineminded
Copy link
Owner

Be sure to activate the venv. The previous log shows venv is not activated.

@machineminded
Copy link
Owner

If you are using PhotoMaker, it requires at least 16GB VRAM, otherwise it will offload to system memory and generation time will be slow. That is a PhotoMaker requirement, nothing I can fix right now.

@tailgunnerx
Copy link
Author

python launch.py --always-gpu

If you are using PhotoMaker, it requires at least 16GB VRAM, otherwise it will offload to system memory and generation time will be slow. That is a PhotoMaker requirement, nothing I can fix right now.

this is Inswapper

@machineminded
Copy link
Owner

I misspoke anyhow. PhotoMaker's docs say 11GB is required. I must have been thinking of InstantID which will be integrated soon.

When running inswapper, do you notice "CPUExecutionProvider" in the log? If so then that is probably why. Let me check the code to make sure it isn't defaulting to CPU for some reason. I am expecting to see "CUDAExecutionProvider".

@tailgunnerx
Copy link
Author

@machineminded
Seems like most of everything works until you start switching back and forth between the different tabs (PhotoMaker deff seems to be the culprit). It seems like one is maybe reserving the CUDA then brining out the CPU when you switch or vice-versa and the error starts appearing.

What actually is the difference between Inswapper and PhotoMaker?

@machineminded
Copy link
Owner

I do notice on my local that inswapper is also using CPUExecutionProvider. I believe I know the root cause, and will test soon.

Inswapper uses insightface to swap faces from a source image to a target image. Meaning, it will overlay a face onto an existing image.

PhotoMaker and InstantID will both use input images to guide the latent space towards a result. They also use huggingface diffusers, whereas the default Fooocus pipelines use ksampler.

If you want to disable PhotoMaker, I would uncheck "Enabled" to unload it from VRAM.

@tailgunnerx
Copy link
Author

tailgunnerx commented Feb 8, 2024

I do notice on my local that inswapper is also using CPUExecutionProvider. I believe I know the root cause, and will test soon.

Inswapper uses insightface to swap faces from a source image to a target image. Meaning, it will overlay a face onto an existing image.

PhotoMaker and InstantID will both use input images to guide the latent space towards a result. They also use huggingface diffusers, whereas the default Fooocus pipelines use ksampler.

If you want to disable PhotoMaker, I would uncheck "Enabled" to unload it from VRAM.

It doesn't seem to be an issue as long as I don't check it in the first place. But yeah I do notice some pixilation around faces when using Inswapper, so that wouldn't happen on PhotoMaker then I suppose?

@machineminded
Copy link
Owner

Inswapper and PhotoMaker are two separate ways to re-create someone's identity. Since PhotoMaker isn't overlaying an image you wouldn't see the pixelation, but the likeness may not be perfect either.

inswapper
PhotoMaker

@tailgunnerx
Copy link
Author

Gotcha, it's still pretty damn impressive though considering you're not actually training a whole model.

@machineminded
Copy link
Owner

You should be able to resolve the inswapper CPU issue by installing onnxruntime-gpu:

pip install onnxruntime-gpu

@tailgunnerx
Copy link
Author

Does this version have Clip Skip? I noticed some models require it

@tailgunnerx
Copy link
Author

You should be able to resolve the inswapper CPU issue by installing onnxruntime-gpu:

pip install onnxruntime-gpu

Installing collected packages: onnxruntime-gpu
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\\Fooocus-inswapper-main\\venv\\Lib\\site-packages\\onnxruntime\\capi\\onnxruntime_providers_shared.dll'
Check the permissions.

@machineminded
Copy link
Owner

Gotcha, it's still pretty damn impressive though considering you're not actually training a whole model.

I should be integrating InstantID soon, which is even more impressive.

Does this version have Clip Skip? I noticed some models require it

PhotoMaker and InstantID would support clip skip, but Fooocus doesn't provide anywhere to set and pass this value. Even the base Fooocus doesn't allow a way to set clip skip.

You should be able to resolve the inswapper CPU issue by installing onnxruntime-gpu:
pip install onnxruntime-gpu

Installing collected packages: onnxruntime-gpu
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\\Fooocus-inswapper-main\\venv\\Lib\\site-packages\\onnxruntime\\capi\\onnxruntime_providers_shared.dll'
Check the permissions.

If the app is running, maybe try stopping the app and run the command again.

@tailgunnerx
Copy link
Author

Gotcha, it's still pretty damn impressive though considering you're not actually training a whole model.

I should be integrating InstantID soon, which is even more impressive.

Does this version have Clip Skip? I noticed some models require it

PhotoMaker and InstantID would support clip skip, but Fooocus doesn't provide anywhere to set and pass this value. Even the base Fooocus doesn't allow a way to set clip skip.

You should be able to resolve the inswapper CPU issue by installing onnxruntime-gpu:
pip install onnxruntime-gpu

Installing collected packages: onnxruntime-gpu
ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\\Fooocus-inswapper-main\\venv\\Lib\\site-packages\\onnxruntime\\capi\\onnxruntime_providers_shared.dll'
Check the permissions.

If the app is running, maybe try stopping the app and run the command again.

Ok that worked

@tailgunnerx
Copy link
Author

Does this version have Clip Skip? I noticed some models require it

is there clip skip btw?

@tailgunnerx
Copy link
Author

Do normal Fooocus features work okay? Is it only doing this on inswapper now?

So everything seems to be working fine as far as I can tell.

The only issue is that I get the "2 devices" error if I'm not in a fresh instance and try to use PhotoMaker. Otherwise it seems like if I use PhotoMaker first it does work. But since this doesn't really get the results I like anyways (and it's resource intensive) I probably won't use it much anyways.

There hasn't been any issues with Inswapper.

I checked out the Inswapper repo and I noticed that it's mainly advertised as a "faceswapper" but I've been using it exclusively as a reference to generate photos of people I know (1 person only at a time though). Is that what your goal was for the plugin? And I noticed there were extra configurations in the description. Are these available to use in your version of Fooocus already?

To improve to quality of face, we can further do face restoration as shown in the full script.

python swapper.py
--source_img="./data/man1.jpeg;./data/man2.jpeg"
--target_img "./data/mans1.jpeg"
--face_restore
--background_enhance
--face_upsample
--upscale=2
--codeformer_fidelity=0.5

@machineminded
Copy link
Owner

They're not yet available. Right now you can only control the target index face where it is applied. Those will be added eventually but working on the InstantID integration now. Re: clip skip, even base Fooocus doesn't support changing this value.

@machineminded
Copy link
Owner

Right now, these are the values being passed. Face restoration is always enabled right now.

background_enhance: true
upscale: 1
codeformer fidelity: 1

The upsampler used is always Real ESRGAN.

@tailgunnerx
Copy link
Author

tailgunnerx commented Feb 9, 2024

Is there any way instead of using the AI generated image for the swap you can input your own picture? It seems like that's how the vanilla version of Inswapper works but not sure how/if it's implemented in this Fooocus version.

@machineminded
Copy link
Owner

That is on my todo list in the readme.md. I am focusing on other things for now but it is identified as an upcoming feature.

@machineminded
Copy link
Owner

@tailgunnerx I created this feature request

#12

@machineminded
Copy link
Owner

Do normal Fooocus features work okay? Is it only doing this on inswapper now?

So everything seems to be working fine as far as I can tell.

The only issue is that I get the "2 devices" error if I'm not in a fresh instance and try to use PhotoMaker. Otherwise it seems like if I use PhotoMaker first it does work. But since this doesn't really get the results I like anyways (and it's resource intensive) I probably won't use it much anyways.

There hasn't been any issues with Inswapper.

I checked out the Inswapper repo and I noticed that it's mainly advertised as a "faceswapper" but I've been using it exclusively as a reference to generate photos of people I know (1 person only at a time though). Is that what your goal was for the plugin? And I noticed there were extra configurations in the description. Are these available to use in your version of Fooocus already?

To improve to quality of face, we can further do face restoration as shown in the full script.
python swapper.py
--source_img="./data/man1.jpeg;./data/man2.jpeg"
--target_img "./data/mans1.jpeg"
--face_restore
--background_enhance
--face_upsample
--upscale=2
--codeformer_fidelity=0.5

My guess is that PhotoMaker is off loading resources to two places which is why you get that error. I'll have to work on optimizing it for 12GB cards I think.

@machineminded
Copy link
Owner

PhotoMaker itself requires 11GB, and with the other stuff that Fooocus loads it may not be possible at the moment.

@tailgunnerx
Copy link
Author

Do normal Fooocus features work okay? Is it only doing this on inswapper now?

So everything seems to be working fine as far as I can tell.
The only issue is that I get the "2 devices" error if I'm not in a fresh instance and try to use PhotoMaker. Otherwise it seems like if I use PhotoMaker first it does work. But since this doesn't really get the results I like anyways (and it's resource intensive) I probably won't use it much anyways.
There hasn't been any issues with Inswapper.
I checked out the Inswapper repo and I noticed that it's mainly advertised as a "faceswapper" but I've been using it exclusively as a reference to generate photos of people I know (1 person only at a time though). Is that what your goal was for the plugin? And I noticed there were extra configurations in the description. Are these available to use in your version of Fooocus already?

To improve to quality of face, we can further do face restoration as shown in the full script.
python swapper.py
--source_img="./data/man1.jpeg;./data/man2.jpeg"
--target_img "./data/mans1.jpeg"
--face_restore
--background_enhance
--face_upsample
--upscale=2
--codeformer_fidelity=0.5

My guess is that PhotoMaker is off loading resources to two places which is why you get that error. I'll have to work on optimizing it for 12GB cards I think.

Because it's so slow for me it's hard to really tell if it's useful (can't generate fast enough for trial and error). If you were to use it are you able to get consistent good results for things like putting in faces of people you know (and actually have it look like them)?

@machineminded
Copy link
Owner

Hmm, I'd say it's close. Totally an opinion, but I think InstantID is much better. I use PhotoMaker with inswapper and it looks okay sometimes. You can experiment with just PhotoMaker here on huggingface:

https://huggingface.co/spaces/TencentARC/PhotoMaker

The results you see out here would be the same you see in my version of Fooocus.

@tailgunnerx
Copy link
Author

tailgunnerx commented Feb 9, 2024

Hmm, I'd say it's close. Totally an opinion, but I think InstantID is much better. I use PhotoMaker with inswapper and it looks okay sometimes. You can experiment with just PhotoMaker here on huggingface:

https://huggingface.co/spaces/TencentARC/PhotoMaker

The results you see out here would be the same you see in my version of Fooocus.

Yeah so even on that I can't get any good results, which slider makes it stronger resemblance?

Maybe it's just my subjects photos too... not good enough possibly.

@machineminded machineminded self-assigned this Feb 9, 2024
@machineminded machineminded added the bug Something isn't working label Feb 9, 2024
@machineminded
Copy link
Owner

I have had mixed results with PhotoMaker. Lots of images and angles definitely helps.

@tailgunnerx
Copy link
Author

Is there a DreamBooth integration coming soon too? 😁

@machineminded
Copy link
Owner

Dreambooth is a training method, not an inference method. You would train a model using the Dreambooth method then load the model and create images with it.

1 similar comment
@machineminded
Copy link
Owner

Dreambooth is a training method, not an inference method. You would train a model using the Dreambooth method then load the model and create images with it.

@tailgunnerx
Copy link
Author

Yeah I know, which works pretty well in 1.5 if you want to make photos of someone. Would be cool if there was like a "lite" version of Dreambooth integration where all the difficult configs are setup already, just need to input the photos. Then generate a LORA or model...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants