import choose_torch_device from ...backend.util.devices

This commit is contained in:
mickr777 2023-07-19 16:43:02 +10:00 committed by GitHub
parent 19d67b29e7
commit d8db618de0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,7 +22,7 @@ from ...backend.stable_diffusion.diffusers_pipeline import (
from ...backend.stable_diffusion.diffusion.shared_invokeai_diffusion import \
PostprocessingSettings
from ...backend.stable_diffusion.schedulers import SCHEDULER_MAP
from ...backend.util.devices import torch_dtype
from ...backend.util.devices import choose_torch_device, torch_dtype
from ..models.image import ImageCategory, ImageField, ResourceOrigin
from .baseinvocation import (BaseInvocation, BaseInvocationOutput,
InvocationConfig, InvocationContext)
@ -38,10 +38,6 @@ from diffusers.models.attention_processor import (
XFormersAttnProcessor,
)
def choose_torch_device() -> str:
device = "cuda" if torch.cuda.is_available() else "cpu"
return device
class LatentsField(BaseModel):
"""A latents field used for passing latents between invocations"""