Skip to content

Commit

Permalink
remove envType config
Browse files Browse the repository at this point in the history
  • Loading branch information
Nuullll committed Dec 15, 2024
1 parent 25772f1 commit 506b106
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 22 deletions.
1 change: 0 additions & 1 deletion WebUI/build/arc-settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"envType": "arc",
"availableThemes": ["dark","lnl","bmg"],
"currentTheme": "bmg"
}
1 change: 0 additions & 1 deletion WebUI/build/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"envType": "arc",
"availableThemes": ["dark","lnl","bmg"],
"currentTheme": "bmg"
}
1 change: 0 additions & 1 deletion WebUI/build/ultra-settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"envType": "ultra",
"availableThemes": ["dark"],
"currentTheme": "dark"
}
1 change: 0 additions & 1 deletion WebUI/build/ultra2-settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"envType": "ultra2",
"availableThemes": ["lnl"],
"currentTheme": "lnl"
}
2 changes: 0 additions & 2 deletions WebUI/electron/electron-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ type Theme = 'dark' | 'lnl' | 'bmg';

type LocalSettings = {
debug: number;
envType: string;
comfyUiParameters?:string[];
} & KVObject;

Expand Down Expand Up @@ -65,7 +64,6 @@ type ModelLists = {
type SetupData = {
modelPaths: ModelPaths,
modelLists: ModelLists,
envType: string,
isAdminExec:boolean,
version:string,
}
Expand Down
2 changes: 0 additions & 2 deletions WebUI/electron/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ const appSize = {
export const settings: LocalSettings = {
isAdminExec: false,
debug: 0,
envType: "ultra",
availableThemes: ["dark", "lnl"],
currentTheme: "lnl",
comfyUiParameters: [],
Expand Down Expand Up @@ -375,7 +374,6 @@ function initEventHandle() {
return {
modelLists: pathsManager.sacanAll(),
modelPaths: pathsManager.modelPaths,
envType: settings.envType,
isAdminExec: settings.isAdminExec,
version: app.getVersion()
};
Expand Down
1 change: 0 additions & 1 deletion WebUI/external/settings-dev.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"envType": "arc",
"debug":1,
"comfyUiParameters": [
"--lowvram",
Expand Down
8 changes: 1 addition & 7 deletions WebUI/src/assets/js/store/globalSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ export const useGlobalSetup = defineStore("globalSetup", () => {

const graphicsList = ref(new Array<GraphicsItem>());

let envType = "";

const loadingState = ref<GlobalSetupState>("verifyBackend");
const errorMessage = ref("");
const hdPersistentConfirmation = ref(localStorage.getItem("HdPersistentConfirmation") === "true");
Expand All @@ -79,7 +77,6 @@ export const useGlobalSetup = defineStore("globalSetup", () => {
async function initSetup() {
const setupData = await window.electronAPI.getInitSetting();
const apiServiceInformation = await window.electronAPI.getServices()
envType = setupData.envType;
paths.value = setupData.modelPaths;
models.value = setupData.modelLists;
models.value.inpaint.push(useI18N().state.ENHANCE_INPAINT_USE_IMAGE_MODEL);
Expand All @@ -104,7 +101,7 @@ export const useGlobalSetup = defineStore("globalSetup", () => {
await window.electronAPI.showMessageBoxSync({ message: useI18N().state.ERROR_UNFOUND_GRAPHICS, title: "error", icon: "error" });
window.electronAPI.exitApp();
}
await loadUserSettings();
loadUserSettings();
}

async function initWebSettings(postJson: string) {
Expand All @@ -122,10 +119,7 @@ export const useGlobalSetup = defineStore("globalSetup", () => {
}

async function reloadGraphics() {
const formData = new FormData();
formData.append("env", envType);
const response = await fetch(`${defaultBackendBaseUrl.value}/api/getGraphics`, {
body: formData,
method: "POST"
});
const graphics = (await response.json()) as GraphicsItem[];
Expand Down
4 changes: 1 addition & 3 deletions service/aipg_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,13 +214,11 @@ def get_ESRGAN_size():
return int(response.headers.get("Content-Length"))


def get_support_graphics(env_type: str):
def get_support_graphics():
device_count = torch.xpu.device_count()
service_config.env_type = env_type
graphics = list()
for i in range(device_count):
device_name = torch.xpu.get_device_name(i)
# if device_name == "Intel(R) Arc(TM) Graphics" or re.search("Intel\(R\) Arc\(TM\)", device_name) is not None:
graphics.append({"index": i, "name": device_name})
return graphics

Expand Down
1 change: 0 additions & 1 deletion service/service_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,3 @@
}

device = "xpu"
env_type = "arc"
3 changes: 1 addition & 2 deletions service/web_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ def get_init_settings():

@app.post("/api/getGraphics")
def get_graphics():
env = request.form.get("env", default="ultra", type=str)
return jsonify(utils.get_support_graphics(env))
return jsonify(utils.get_support_graphics())


@app.get("/api/applicationExit")
Expand Down

0 comments on commit 506b106

Please sign in to comment.