Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Skipping unknown extra network: lora #9274

Closed
1 task done
ykallan opened this issue Apr 1, 2023 · 5 comments
Closed
1 task done

[Bug]: Skipping unknown extra network: lora #9274

ykallan opened this issue Apr 1, 2023 · 5 comments
Labels
bug-report Report of a bug, yet to be confirmed

Comments

@ykallan
Copy link

ykallan commented Apr 1, 2023

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

What happened?

i start api server by command:
webui.bat --nowebui --enable-insecure-extension-access
but got

Skipping unknown extra network: lora

Steps to reproduce the problem

  1. Go to ....
  2. Press ....
  3. ...

What should have happened?

INFO:     Started server process [17088]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:7861 (Press CTRL+C to quit)
Skipping unknown extra network: lora
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:04<00:00,  4.35it/s]
INFO:     127.0.0.1:60194 - "POST /sdapi/v1/txt2img HTTP/1.1" 200 OK███████████████████| 20/20 [00:03<00:00,  7.28it/s]
INFO:     127.0.0.1:60199 - "POST /sdapi/v1/png-info HTTP/1.1" 200 OK

cannot load the lora

Commit where the problem happens

webui.bat --nowebui --enable-insecure-extension-access

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Mozilla Firefox

Command Line Arguments

import io
import requests
import base64
from PIL import Image, PngImagePlugin

url = "http://localhost:7861"

prompt = """
<lora:chineseGirl_v10:0.1><lora:cuteGirlMix4_v10:0.2><lora:chineseQingchunGirl_chineseQingchunGirl:0.2><lora:dreamyGirlsFace_dreamyFace:0.5>, (8k, RAW photo, best quality, masterpiece:1.3),(realistic, photo-realistic:1.37),posing,sea beach,nightcityscape,night, cyberpunk city,soft light,1girl,extremely beautiful face,bust,(put down hands), Random hairstyle,white hair,Random expression,small eyes, ,lower abdomen
"""

negative_prompt = """
nsfw, NSFW, paintings, sketches, (worst quality:2), (low quality:2), (normal quality:2), lowres, normal quality, ((monochrome)), ((grayscale)), skin spots, acnes, skin blemishes, age spot, glans, strange fingers
"""

data = {"prompt": prompt.strip(),
        "n_iter": 1,
        "steps": 20,
        "cfg_scale": 7,
        "negative_prompt": negative_prompt.strip(),
        "Sampler": "DPM++ 2M Karras",
        "width": 512,
        "height": 768,
        "Model": "chilloutmix_NiPrunedFp32Fix.safetensors [fc2511737a]",
        "send_images": True,
        "save_images": True,
        "seed": -1,
        "subseed": -1,
        "subseed_strength": 0,

        }

response = requests.post(url=f"{url}/sdapi/v1/txt2img", json=data)

with open("./resp.png", "wb") as f:
    f.write(response.content)

print(response.headers)
print(response.status_code)

# print(response.text)
resp = response.json()
for idx, i in enumerate(resp['images']):
    image = Image.open(io.BytesIO(base64.b64decode(i.split(",", 1)[0])))
    png_payload = {
        "image": "data:image/png;base64," + i
    }
    response2 = requests.post(url=f'{url}/sdapi/v1/png-info', json=png_payload)
    pnginfo = PngImagePlugin.PngInfo()
    pnginfo.add_text("parameters", response2.json().get("info"))
    image.save(f'output_{idx}.png', pnginfo=pnginfo)

List of extensions

Skipping unknown extra network: lora

Console logs

INFO:     Started server process [17088]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:7861 (Press CTRL+C to quit)
Skipping unknown extra network: lora
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:04<00:00,  4.35it/s]
INFO:     127.0.0.1:60194 - "POST /sdapi/v1/txt2img HTTP/1.1" 200 OK███████████████████| 20/20 [00:03<00:00,  7.28it/s]
INFO:     127.0.0.1:60199 - "POST /sdapi/v1/png-info HTTP/1.1" 200 OK
Skipping unknown extra network: lora
100%|██████████████████████████████████████████████████████████████████████████████████| 20/20 [00:03<00:00,  5.13it/s]
INFO:     127.0.0.1:60316 - "POST /sdapi/v1/txt2img HTTP/1.1" 200 OK
INFO:     127.0.0.1:60319 - "POST /sdapi/v1/png-info HTTP/1.1" 200 OK

Additional information

i got the img, but i cannot use the lora extentions,

then i add command

def api_only():
    initialize()

    app = FastAPI()
    setup_middleware(app)
    api = create_api(app)

    modules.script_callbacks.app_started_callback(None, app)  # this is i add

    print(f"Startup time: {startup_timer.summary()}.")
    api.launch(server_name="0.0.0.0" if cmd_opts.listen else "127.0.0.1", port=cmd_opts.port if cmd_opts.port else 7861)

but its does not work at all.

@ykallan ykallan added the bug-report Report of a bug, yet to be confirmed label Apr 1, 2023
@Roshag
Copy link

Roshag commented Apr 2, 2023

Built-in extension does not work atm with different errors. The original one by kohya-ss works, but it is much less convenient to use.

@ykallan
Copy link
Author

ykallan commented Apr 2, 2023

Built-in extension does not work atm with different errors. The original one by kohya-ss works, but it is much less convenient to use.

want to know how can i use lora model by api

@nicosezam
Copy link

I also need the API works with Lora models

@PandaXu313
Copy link

PandaXu313 commented May 4, 2023

I used the solution in the 7984 and it works

@catboxanon
Copy link
Collaborator

Duplicate of #7984 -- resolved by #12387

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Report of a bug, yet to be confirmed
Projects
None yet
Development

No branches or pull requests

5 participants