"armsr-armv8/imm.config" did not exist on "32c95ad264a5ed6d3a420122301432ffbba874b8"
qwenimage.py 1.07 KB
Newer Older
wuxk1's avatar
wuxk1 committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""
This module provides a wrapper for ComfyUI's Qwen-Image model configuration.
"""

import torch
from comfy.supported_models import QwenImage

from .. import model_base


class NunchakuQwenImage(QwenImage):
    """
    Wrapper for the Nunchaku Qwen-Image model configuration.
    """

    def get_model(
        self, state_dict: dict[str, torch.Tensor], prefix: str = "", device=None, **kwargs
    ) -> model_base.NunchakuQwenImage:
        """
        Instantiate and return a NunchakuQwenImage model.

        Parameters
        ----------
        state_dict : dict
            Model state dictionary.
        prefix : str, optional
            Prefix for parameter names (default is "").
        device : torch.device or str, optional
            Device to load the model onto.
        **kwargs
            Additional keyword arguments for model initialization.

        Returns
        -------
        model_base.NunchakuQwenImage
            Instantiated NunchakuQwenImage model.
        """
        out = model_base.NunchakuQwenImage(self, device=device, **kwargs)
        return out