Update some dependencies. Repair some codes.

This commit is contained in:
hodanov
2024-04-21 12:40:44 +09:00
parent 4fe518038d
commit e1639039d7
8 changed files with 63 additions and 65 deletions
+4 -4
View File
@@ -3,11 +3,11 @@ import time
import modal
import util
stub = modal.Stub("run-stable-diffusion-cli")
stub.run_inference = modal.Function.from_name("stable-diffusion-cli", "SD15.run_txt2img_inference")
app = modal.App("run-stable-diffusion-cli")
app.run_inference = modal.Function.from_name("stable-diffusion-cli", "SD15.run_txt2img_inference")
@stub.local_entrypoint()
@app.local_entrypoint()
def main(
prompt: str,
n_prompt: str,
@@ -33,7 +33,7 @@ def main(
if seed == -1:
seed_generated = util.generate_seed()
start_time = time.time()
images = stub.run_inference.remote(
images = app.run_inference.remote(
prompt=prompt,
n_prompt=n_prompt,
height=height,
+8 -4
View File
@@ -3,16 +3,18 @@ import time
import modal
import util
stub = modal.Stub("run-stable-diffusion-cli")
stub.run_inference = modal.Function.from_name("stable-diffusion-cli", "SDXLTxt2Img.run_inference")
app = modal.Stub("run-stable-diffusion-cli")
app.run_inference = modal.Function.from_name("stable-diffusion-cli", "SDXLTxt2Img.run_inference")
@stub.local_entrypoint()
@app.local_entrypoint()
def main(
prompt: str,
n_prompt: str,
height: int = 1024,
width: int = 1024,
samples: int = 5,
steps: int = 20,
seed: int = -1,
upscaler: str = "",
use_face_enhancer: str = "False",
@@ -29,10 +31,12 @@ def main(
if seed == -1:
seed_generated = util.generate_seed()
start_time = time.time()
images = stub.run_inference.remote(
images = app.run_inference.remote(
prompt=prompt,
n_prompt=n_prompt,
height=height,
width=width,
steps=steps,
seed=seed_generated,
upscaler=upscaler,
use_face_enhancer=use_face_enhancer == "True",