File size: 689 Bytes
a262592
c39cce5
194051d
a262592
 
 
c39cce5
86cb956
f53f2d2
c39cce5
a262592
f53f2d2
eb993d1
f53f2d2
eb993d1
f53f2d2
1aa28b0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from typing import Dict, List, Any
from diffusers import ControlNetModel, StableDiffusionControlNetPipeline, StableDiffusionPipeline, DiffusionPipeline


class EndpointHandler():
    def __init__(self, path=""):
        self.pipeline = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0")
        self.pipeline.load_lora_weights(".", weight_name="/repository/safetensors.safetensors")
        print('hiiiii')

    def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
        print('data:', data)
        input = data['inputs']
        print('input:', input)
        result = self.pipeline(input)
        print('result:', result)
        return result