mirror of
https://github.com/imrayya/stable-diffusion-webui-Prompt_Generator.git
synced 2024-01-11 09:00:44 +01:00
Removed extension path hard coded #21
This commit is contained in:
@@ -12,16 +12,19 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|||||||
|
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
import gradio as gr
|
import gradio as gr
|
||||||
import modules
|
import modules
|
||||||
|
from pathlib import Path
|
||||||
from modules import script_callbacks
|
from modules import script_callbacks
|
||||||
|
import modules.scripts as scripts
|
||||||
from transformers import GPT2LMHeadModel, GPT2Tokenizer
|
from transformers import GPT2LMHeadModel, GPT2Tokenizer
|
||||||
|
|
||||||
result_prompt = ""
|
result_prompt = ""
|
||||||
models = {}
|
models = {}
|
||||||
max_no_results = 20 # TODO move to setting panel
|
max_no_results = 20 # TODO move to setting panel
|
||||||
|
model_file = Path(scripts.basedir(), "models.json")
|
||||||
|
|
||||||
class Model:
|
class Model:
|
||||||
'''
|
'''
|
||||||
@@ -38,7 +41,8 @@ class Model:
|
|||||||
def populate_models():
|
def populate_models():
|
||||||
"""Get the models that this extension can use via models.json
|
"""Get the models that this extension can use via models.json
|
||||||
"""
|
"""
|
||||||
path = "./extensions/stable-diffusion-webui-Prompt_Generator/models.json"
|
#TODO add button to refresh and update model list
|
||||||
|
path = model_file
|
||||||
with open(path, 'r') as f:
|
with open(path, 'r') as f:
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
for item in data:
|
for item in data:
|
||||||
|
|||||||
Reference in New Issue
Block a user