Spaces:
Sleeping
Sleeping
Update src/model_server.py
Browse files- src/model_server.py +9 -2
src/model_server.py
CHANGED
@@ -27,7 +27,7 @@ def run_stable_diffusion(prompt: str):
|
|
27 |
|
28 |
pipe = StableDiffusionPipeline.from_pretrained(
|
29 |
"runwayml/stable-diffusion-v1-5",
|
30 |
-
use_auth_token=os.environ["
|
31 |
).to("cuda")
|
32 |
|
33 |
image = pipe(prompt, num_inference_steps=10).images[0]
|
@@ -365,4 +365,11 @@ def optimize(pipe, compile=True):
|
|
365 |
|
366 |
if __name__ == "__main__":
|
367 |
print("Starting Modal Flux API server...")
|
368 |
-
# This will be handled by Modal's deployment
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
pipe = StableDiffusionPipeline.from_pretrained(
|
29 |
"runwayml/stable-diffusion-v1-5",
|
30 |
+
use_auth_token=os.environ["CLIENT_TOKEN1"],
|
31 |
).to("cuda")
|
32 |
|
33 |
image = pipe(prompt, num_inference_steps=10).images[0]
|
|
|
365 |
|
366 |
if __name__ == "__main__":
|
367 |
print("Starting Modal Flux API server...")
|
368 |
+
# This will be handled by Modal's deployment
|
369 |
+
# Already inside the Modal container → call directly
|
370 |
+
result = model_instance.inference(
|
371 |
+
request.prompt,
|
372 |
+
request.num_inference_steps,
|
373 |
+
request.width,
|
374 |
+
request.height
|
375 |
+
)
|