()
| 782 | } |
| 783 | |
| 784 | function applyInputState() { |
| 785 | const state = loadInputState(); |
| 786 | if (!state) { |
| 787 | return; |
| 788 | } |
| 789 | if (typeof state.methodText === "string") { |
| 790 | $("methodText").value = state.methodText; |
| 791 | } |
| 792 | if (typeof state.provider === "string" && providerInput) { |
| 793 | providerInput.value = normalizeProviderValue(state.provider); |
| 794 | } |
| 795 | if (typeof state.imageProvider === "string" && imageProviderInput) { |
| 796 | imageProviderInput.value = normalizeImageProviderValue(state.imageProvider); |
| 797 | } |
| 798 | if (typeof state.imageModel === "string" && imageModelInput) { |
| 799 | imageModelInput.value = state.imageModel; |
| 800 | } |
| 801 | if (typeof state.svgModel === "string" && svgModelInput) { |
| 802 | svgModelInput.value = state.svgModel; |
| 803 | } |
| 804 | if (typeof state.apiKey === "string") { |
| 805 | $("apiKey").value = state.apiKey; |
| 806 | } |
| 807 | if (typeof state.baseUrl === "string" && baseUrlInput) { |
| 808 | baseUrlInput.value = state.baseUrl; |
| 809 | } |
| 810 | if (typeof state.imageApiKey === "string" && imageApiKeyInput) { |
| 811 | imageApiKeyInput.value = state.imageApiKey; |
| 812 | } |
| 813 | if (typeof state.imageBaseUrl === "string" && imageBaseUrlInput) { |
| 814 | imageBaseUrlInput.value = state.imageBaseUrl; |
| 815 | } |
| 816 | if (typeof state.optimizeIterations === "string" && $("optimizeIterations")) { |
| 817 | $("optimizeIterations").value = state.optimizeIterations; |
| 818 | } |
| 819 | if (typeof state.imageSize === "string" && imageSizeInput) { |
| 820 | imageSizeInput.value = state.imageSize; |
| 821 | } |
| 822 | if (typeof state.upscaleEnabled === "boolean" && upscaleEnabled) { |
| 823 | upscaleEnabled.checked = state.upscaleEnabled; |
| 824 | } |
| 825 | if (typeof state.samBackend === "string" && samBackend) { |
| 826 | samBackend.value = state.samBackend; |
| 827 | } |
| 828 | if (typeof state.samPrompt === "string" && samPrompt) { |
| 829 | samPrompt.value = state.samPrompt; |
| 830 | } |
| 831 | if (typeof state.samApiKey === "string" && samApiKeyInput) { |
| 832 | samApiKeyInput.value = state.samApiKey; |
| 833 | } |
| 834 | if (typeof state.referencePath === "string" && state.referencePath) { |
| 835 | uploadedReferencePath = state.referencePath; |
| 836 | } |
| 837 | if ( |
| 838 | referencePreview && |
| 839 | typeof state.referenceUrl === "string" && |
| 840 | state.referenceUrl |
| 841 | ) { |
no test coverage detected