first cimmit

This commit is contained in:
zcr
2026-01-26 11:40:11 +08:00
parent 71400cff38
commit dc2c1ddb03
11 changed files with 27 additions and 27 deletions

View File

@@ -9,5 +9,5 @@ request_data = {
"infer_step":4,
"tasks_id":"123456-123"
}
response = requests.post("http://127.0.0.1:8012//api/v1/to_product", json=request_data)
response = requests.post("http://127.0.0.1:10090//api/v1/to_product", json=request_data)
print(f"Status: {response.status_code}\nResponse:\n {response.text}")

View File

@@ -1,4 +1,6 @@
import io
import os
import torch
import litserve as ls
from diffusers import Flux2KleinPipeline
@@ -15,7 +17,8 @@ class Flux2KleinServer(ls.LitAPI):
# Load the model
dtype = torch.bfloat16
self.device = device
self.model = Flux2KleinPipeline.from_pretrained("black-forest-labs/FLUX.2-klein-4B", torch_dtype=dtype, is_distilled=False)
model_path = os.path.join(settings.FLUX2_KLEIN_MODEL_PATH, "FLUX.2-klein-4B")
self.model = Flux2KleinPipeline.from_pretrained(model_path, torch_dtype=dtype, is_distilled=False)
self.model.to(device) # save some VRAM by offloading the model to CPU
def decode_request(self, request):