Fix for QR Art blank page issue (#43)

This commit is contained in:
AceDataCloud committed 2024-05-14 02:43:03 +00:00
1 parent afc3679c57
commit 958a530add
5 files changed
+38 -32

No files matched your search

@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "fix for qrart blank issue",
"packageName": "@acedatacloud/hub",
"email": "germey@acedata.cloud",
"dependentChangeType": "patch"
}
+9 -9
View File
@@ -9,15 +9,15 @@
<steps-selector class="mb-4" /> <steps-selector class="mb-4" />
<preset-selector class="mb-4" /> <preset-selector class="mb-4" />
<advanced-selector class="mb-4" /> <advanced-selector class="mb-4" />
<seed-input v-if="config.advanced" class="mb-4" /> <seed-input v-if="config?.advanced" class="mb-4" />
<position-selector v-if="config.advanced" class="mb-4" /> <position-selector v-if="config?.advanced" class="mb-4" />
<pixel-style-selector v-if="config.advanced" class="mb-4" /> <pixel-style-selector v-if="config?.advanced" class="mb-4" />
<marker-shape-selector v-if="config.advanced" class="mb-4" /> <marker-shape-selector v-if="config?.advanced" class="mb-4" />
<sub-marker-selector v-if="config.advanced" class="mb-4" /> <sub-marker-selector v-if="config?.advanced" class="mb-4" />
<rotate-selector v-if="config.advanced" class="mb-4" /> <rotate-selector v-if="config?.advanced" class="mb-4" />
<ecl-selector v-if="config.advanced" class="mb-4" /> <ecl-selector v-if="config?.advanced" class="mb-4" />
<padding-level-selector v-if="config.advanced" class="mb-4" /> <padding-level-selector v-if="config?.advanced" class="mb-4" />
<padding-noise-selector v-if="config.advanced" class="mb-4" /> <padding-noise-selector v-if="config?.advanced" class="mb-4" />
</div> </div>
<div class="actions"> <div class="actions">
<el-button type="primary" class="btn" round @click="onGenerate"> <el-button type="primary" class="btn" round @click="onGenerate">
@@ -18,12 +18,12 @@ export default defineComponent({
computed: { computed: {
value: { value: {
get() { get() {
return this.$store.state.qrart.config?.advanced; return this.$store.state.qrart?.config?.advanced;
}, },
set(val) { set(val) {
console.debug('set advanced', val); console.debug('set advanced', val);
this.$store.commit('qrart/setConfig', { this.$store.commit('qrart/setConfig', {
...this.$store.state.qrart.config, ...this.$store.state.qrart?.config,
advanced: val advanced: val
}); });
} }
@@ -8,7 +8,6 @@
<script> <script>
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import { ElSwitch } from 'element-plus'; import { ElSwitch } from 'element-plus';
import { QRART_DEFAULT_ADVANCED } from '@/constants';
export default defineComponent({ export default defineComponent({
name: 'RawurlSelector', name: 'RawurlSelector',
@@ -18,12 +17,12 @@ export default defineComponent({
computed: { computed: {
value: { value: {
get() { get() {
return this.$store.state.qrart.config?.rawurl; return this.$store.state.qrart?.config?.rawurl;
}, },
set(val) { set(val) {
console.debug('set rawurl', val); console.debug('set rawurl', val);
this.$store.commit('qrart/setConfig', { this.$store.commit('qrart/setConfig', {
...this.$store.state.qrart.config, ...this.$store.state.qrart?.config,
rawurl: val rawurl: val
}); });
} }
+18 -18
View File
@@ -124,41 +124,41 @@ export default defineComponent({
if (this.elements.length > 0) { if (this.elements.length > 0) {
content += ',' + this.elements.join(','); content += ',' + this.elements.join(',');
} }
if (this.preset.model && !content.includes(`--${this.preset.model}`)) { if (this.preset?.model && !content.includes(`--${this.preset.model}`)) {
content += ` --${this.preset.model}`; content += ` --${this.preset.model}`;
} }
if (this.preset.version && !content.includes(`--version `) && !content.includes(`--v `)) { if (this.preset?.version && !content.includes(`--version `) && !content.includes(`--v `)) {
content += ` --version ${this.preset.version}`; content += ` --version ${this.preset.version}`;
} }
if (this.preset.chaos && this.preset.advanced && !content.includes(`--chaos `)) { if (this.preset?.chaos && this.preset?.advanced && !content.includes(`--chaos `)) {
content += ` --chaos ${this.preset.chaos}`; content += ` --chaos ${this.preset.chaos}`;
} }
if (this.preset.quality && !content.includes(`--quality `) && !content.includes(`--q `)) { if (this.preset?.quality && !content.includes(`--quality `) && !content.includes(`--q `)) {
content += ` --quality ${this.preset.quality}`; content += ` --quality ${this.preset.quality}`;
} }
if ( if (
this.preset.ratio && this.preset?.ratio &&
!content.includes(`--aspect `) && !content.includes(`--aspect `) &&
!content.includes(`--ar `) && !content.includes(`--ar `) &&
this.preset.ratio !== MIDJOURNEY_DEFAULT_RATIO this.preset?.ratio !== MIDJOURNEY_DEFAULT_RATIO
) { ) {
content += ` --aspect ${this.preset.ratio}`; content += ` --aspect ${this.preset.ratio}`;
} }
if ( if (
this.preset.stylize && this.preset?.stylize &&
!content.includes(`--stylize `) && !content.includes(`--stylize `) &&
!content.includes(`--s `) && !content.includes(`--s `) &&
this.preset.advanced && this.preset?.advanced &&
this.preset.stylize !== MIDJOURNEY_DEFAULT_STYLIZE this.preset?.stylize !== MIDJOURNEY_DEFAULT_STYLIZE
) { ) {
content += ` --stylize ${this.preset.stylize}`; content += ` --stylize ${this.preset?.stylize}`;
} }
if ( if (
this.preset.weird && this.preset?.weird &&
!content.includes(`--weird `) && !content.includes(`--weird `) &&
!content.includes(`--w `) && !content.includes(`--w `) &&
this.preset.advanced && this.preset?.advanced &&
this.preset.weird !== MIDJOURNEY_DEFAULT_WIRED this.preset?.weird !== MIDJOURNEY_DEFAULT_WIRED
) { ) {
content += ` --weird ${this.preset.weird}`; content += ` --weird ${this.preset.weird}`;
} }
@@ -166,15 +166,15 @@ export default defineComponent({
content += ` --no ${this.ignore}`; content += ` --no ${this.ignore}`;
} }
if ( if (
this.preset.iw && this.preset?.iw &&
!content.includes(`--iw `) && !content.includes(`--iw `) &&
this.preset.advanced && this.preset?.advanced &&
this.preset.iw !== MIDJOURNEY_DEFAULT_IMAGE_WEIGHT this.preset?.iw !== MIDJOURNEY_DEFAULT_IMAGE_WEIGHT
) { ) {
content += ` --iw ${this.preset.iw}`; content += ` --iw ${this.preset.iw}`;
} }
if (this.preset.style && this.preset.advanced && !content.includes(`--style`)) { if (this.preset?.style && this.preset?.advanced && !content.includes(`--style`)) {
content += ` --style ${this.preset.style}`; content += ` --style ${this.preset?.style}`;
} }
return this.prompt || this.references?.length > 0 ? content : ''; return this.prompt || this.references?.length > 0 ? content : '';
} }