Skip to content

Commit

Permalink
fix: impact_sampling - potential device mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
ltdrdata committed Aug 5, 2024
1 parent b2d12d0 commit adb2a97
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/impact/config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import configparser
import os

version_code = [6, 0, 1]
version_code = [6, 0, 2]
version = f"V{version_code[0]}.{version_code[1]}" + (f'.{version_code[2]}' if len(version_code) > 2 else '')

dependency_version = 22
Expand Down
8 changes: 8 additions & 0 deletions modules/impact/impact_sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import comfy
import torch
import math
import comfy.model_management as mm


try:
Expand Down Expand Up @@ -151,6 +152,13 @@ def touched_callback(step, x0, x, total_steps):
positive = node_helpers.conditioning_set_values(positive, {"guidance": cfg})
guider.set_conds(positive)

device = mm.get_torch_device()

noise = noise.to(device)
latent_image = latent_image.to(device)
if noise_mask is not None:
noise_mask = noise_mask.to(device)

samples = guider.sample(noise, latent_image, sampler, sigmas, denoise_mask=noise_mask, callback=touched_callback, disable_pbar=disable_pbar, seed=noise_seed)
samples = samples.to(comfy.model_management.intermediate_device())

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "comfyui-impact-pack"
description = "This extension offers various detector nodes and detailer nodes that allow you to configure a workflow that automatically enhances facial details. And provide iterative upscaler."
version = "6.0.1"
version = "6.0.2"
license = { file = "LICENSE.txt" }
dependencies = ["segment-anything", "scikit-image", "piexif", "transformers", "opencv-python-headless", "GitPython", "scipy>=1.11.4"]

Expand Down

0 comments on commit adb2a97

Please sign in to comment.