You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SettingsPreferences.vue 4.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <div class="preferences">
  3. <!-- Basics -->
  4. <section id="preferences-basics" class="box">
  5. <div class="box__content">
  6. <SettingsField v-model="value$" field-id="preferences.mode" :options-field="optionsField" />
  7. <SettingsField v-if="value$.mode > 0"
  8. v-model="value$"
  9. field-id="preferences.advanced.scaleMode"
  10. :options-field="optionsField" />
  11. </div>
  12. </section>
  13. <!-- Runs -->
  14. <section v-if="value$.mode === 2" id="preferences-runs" class="box">
  15. <div class="box__header">
  16. <h2 class="title">
  17. Per run.
  18. </h2>
  19. <h3 class="subtitle">
  20. Customize body preferences for multiple runs.
  21. </h3>
  22. </div>
  23. <div class="box__content">
  24. <SettingsField
  25. v-model="value$"
  26. field-id="preferences.body.runs.mode" />
  27. <SettingsField v-if="value$.body.runs.mode !== false" v-model="value$" field-id="preferences.body.runs.count" />
  28. <SettingsField v-if="value$.body.runs.mode === 'increase'"
  29. v-model="value$"
  30. field-id="preferences.body.runs.rate"
  31. :description="`Body preferences will increase ${value$.body.runs.rate} at each run.`" />
  32. </div>
  33. </section>
  34. <!-- Boobs -->
  35. <Preference id="preferences-body"
  36. v-model="value$.body.boobs"
  37. label="Boobs"
  38. :min="0" />
  39. <!-- Areola -->
  40. <Preference v-model="value$.body.areola"
  41. label="Areola"
  42. :min="0" />
  43. <!-- Nipple -->
  44. <Preference v-model="value$.body.nipple"
  45. label="Nipple"
  46. :min="0" />
  47. <!-- Vagina -->
  48. <Preference v-model="value$.body.vagina"
  49. label="Vagina"
  50. :max="1.5" />
  51. <!-- Pubic Hair -->
  52. <Preference v-model="value$.body.pubicHair"
  53. label="Pubic Hair"
  54. :min="0" />
  55. <!-- Advanced -->
  56. <section v-if="value$.mode > 1" id="preferences-advanced" class="box">
  57. <div class="box__header">
  58. <h2 class="title">
  59. Advanced.
  60. </h2>
  61. <h3 class="subtitle">
  62. Additional processing settings.
  63. </h3>
  64. </div>
  65. <div class="box__content">
  66. <SettingsField v-if="!isMacOS" v-model="value$" field-id="preferences.advanced.device" />
  67. <SettingsField v-else field-id="preferences.advanced.device" description="Mac only supports CPU.">
  68. <select v-model="value$.advanced.device" class="input" disabled>
  69. <option value="CPU">
  70. CPU
  71. </option>
  72. </select>
  73. </SettingsField>
  74. <SettingsField v-show="value$.advanced.scaleMode !== 'none'" v-model="value$" field-id="preferences.advanced.imageSize" />
  75. <SettingsField v-model="value$" field-id="preferences.advanced.compress" />
  76. <SettingsField v-show="value$.advanced.scaleMode === 'padding'" v-model="value$" field-id="preferences.advanced.useColorPaddingStrip" />
  77. <SettingsField v-model="value$" field-id="preferences.advanced.useColorTransfer" />
  78. </div>
  79. </section>
  80. <!-- Waifu2X -->
  81. <section v-if="value$.mode > 1 && !animated" class="box">
  82. <div class="box__header">
  83. <h2 class="title">
  84. Waifu2X.
  85. </h2>
  86. <h3 class="subtitle">
  87. Settings for the upscale and denoise algorithm.
  88. </h3>
  89. </div>
  90. <div v-if="requirements.canUseWaifu" class="box__content">
  91. <SettingsField v-model="value$" field-id="preferences.advanced.waifu.enabled" />
  92. <div v-if="value$.advanced.waifu.enabled">
  93. <SettingsField v-model="value$" field-id="preferences.advanced.waifu.scale" />
  94. <SettingsField v-model="value$" field-id="preferences.advanced.waifu.denoise" />
  95. <SettingsField v-model="value$" field-id="preferences.advanced.waifu.tta" />
  96. <SettingsField v-model="value$" field-id="preferences.advanced.waifu.arch" />
  97. </div>
  98. </div>
  99. <div v-else class="box__content">
  100. <nuxt-link to="/wizard/waifu" class="underline">
  101. Install Waifu2X to use this feature.
  102. </nuxt-link>
  103. </div>
  104. </section>
  105. </div>
  106. </template>
  107. <script>
  108. import { tutorial } from '~/modules'
  109. import { requirements } from '~/modules/system'
  110. import { VModel } from '~/mixins'
  111. export default {
  112. mixins: [VModel],
  113. props: {
  114. animated: {
  115. type: Boolean,
  116. default: false,
  117. },
  118. },
  119. data: () => ({
  120. requirements,
  121. }),
  122. computed: {
  123. optionsField() {
  124. return this.animated ? 'animated-options' : 'options'
  125. },
  126. isMacOS() {
  127. return process.platform === 'darwin'
  128. },
  129. },
  130. mounted() {
  131. tutorial.preferences()
  132. },
  133. }
  134. </script>
  135. <style lang="scss" scoped>
  136. .preferences {
  137. &::v-deep {
  138. .box .box__header {
  139. @apply pt-6;
  140. }
  141. }
  142. }
  143. </style>