Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -22,8 +22,9 @@ async def generate_image(prompt, model, lora_word, width, height, scales, steps,
|
|
22 |
try:
|
23 |
if seed == -1:
|
24 |
seed = random.randint(0, MAX_SEED)
|
|
|
25 |
seed = int(seed)
|
26 |
-
|
27 |
text = str(Translator().translate(prompt, 'English')) + "," + lora_word
|
28 |
client = AsyncInferenceClient()
|
29 |
image = await client.text_to_image(prompt=text, height=height, width=width, guidance_scale=scales, num_inference_steps=steps, model=model)
|
@@ -43,7 +44,7 @@ def get_upscale_finegrain(prompt, img_path, upscale_factor):
|
|
43 |
|
44 |
async def gen(prompt, basemodel, width, height, scales, steps, seed, upscale_factor, process_upscale, lora_model, process_lora):
|
45 |
model = enable_lora(lora_model, basemodel) if process_lora else basemodel
|
46 |
-
|
47 |
image, seed = await generate_image(prompt, model, "", width, height, scales, steps, seed)
|
48 |
if image is None:
|
49 |
return [None, None]
|
|
|
22 |
try:
|
23 |
if seed == -1:
|
24 |
seed = random.randint(0, MAX_SEED)
|
25 |
+
print(seed)
|
26 |
seed = int(seed)
|
27 |
+
|
28 |
text = str(Translator().translate(prompt, 'English')) + "," + lora_word
|
29 |
client = AsyncInferenceClient()
|
30 |
image = await client.text_to_image(prompt=text, height=height, width=width, guidance_scale=scales, num_inference_steps=steps, model=model)
|
|
|
44 |
|
45 |
async def gen(prompt, basemodel, width, height, scales, steps, seed, upscale_factor, process_upscale, lora_model, process_lora):
|
46 |
model = enable_lora(lora_model, basemodel) if process_lora else basemodel
|
47 |
+
|
48 |
image, seed = await generate_image(prompt, model, "", width, height, scales, steps, seed)
|
49 |
if image is None:
|
50 |
return [None, None]
|