Skip to content

Commit

Permalink
Update for setting ComfyUI GW address
Browse files Browse the repository at this point in the history
  • Loading branch information
jordenyt committed Nov 12, 2024
1 parent bb0e443 commit 0e67866
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion app/src/main/java/com/jsoft/diffusionpaint/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ private boolean validateSettings() {
builder.setMessage(R.string.app_not_configured_message);
builder.setNegativeButton(R.string.cancel, (dialog, which) -> dialog.dismiss());
builder.setPositiveButton(R.string.configure, (dialog, which) -> {
showTextInputDialog("dflApiAddress", "DFL API Address:", "http://192.168.1.101:5000", "");
showTextInputDialog("dflApiAddress", "ComfyUI GW Address:", "http://192.168.1.101:5000", "");
dialog.dismiss();
});

Expand Down Expand Up @@ -645,6 +645,11 @@ private void showTextInputDialog(String key, String title, String hint, String d
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putString(key, inputText);
editor.apply();
if ("dflApiAddress".equals(key)) {
if (Utils.isValidServerURL(inputText)) {
sdApiHelper.sendRequest("getComfyuiMode", inputText, "/mode_config", null, "GET");
}
}
dialog.dismiss();
} else {
Toast.makeText(getApplicationContext(), "Invalid JSON", Toast.LENGTH_SHORT).show();
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/menu/sd_setting.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:title="Settings">
<menu>
<item android:id="@+id/mi_dfl_api_address" android:title="SD Server Address"/>
<item android:id="@+id/mi_dfl_api_address" android:title="ComfyUI GW Address"/>
<item android:title="Default Parameters">
<menu>
<item android:id="@+id/mi_sd_output_dim" android:title="Default SD Output Dimension"/>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<string name="my_images">My images</string>
<string name="no_recent_immages">No recent images</string>
<string name="app_not_configured_title">App not configured</string>
<string name="app_not_configured_message">Before using the app you have to configure Automatic1111 server address.</string>
<string name="app_not_configured_message">Before using the app you have to configure ComfyUI GW address.</string>


<string-array name="sd_size_options">
Expand Down

0 comments on commit 0e67866

Please sign in to comment.