Delete sd_feed
Browse files- sd_feed/.DS_Store +0 -0
- sd_feed/.gitignore +0 -5
- sd_feed/Readme.md +0 -82
- sd_feed/assets/5ulvww8bblta1.webp +0 -0
- sd_feed/assets/extensions.png +0 -0
- sd_feed/assets/feed.png +0 -0
- sd_feed/assets/feedsetting1.png +0 -0
- sd_feed/assets/lhijrt5lblta1.webp +0 -0
- sd_feed/assets/pinterest.png +0 -3
- sd_feed/assets/potd.png +0 -0
- sd_feed/assets/share.png +0 -0
- sd_feed/assets/shareandearn.png +0 -0
- sd_feed/html/feedtab.html +0 -291
- sd_feed/html/lora.html +0 -24
- sd_feed/html/potd.html +0 -135
- sd_feed/html/profile.html +0 -21
- sd_feed/install.py +0 -5
- sd_feed/javascript/axios.min.js +0 -2
- sd_feed/javascript/best_feed.js +0 -638
- sd_feed/javascript/goosviewmodel.js +0 -860
- sd_feed/javascript/loradownload.js +0 -55
- sd_feed/javascript/userprofile.js +0 -74
- sd_feed/javascript/vue.global.js +0 -0
- sd_feed/newtype_v3/__init__.py +0 -0
- sd_feed/newtype_v3/__pycache__/__init__.cpython-310.pyc +0 -0
- sd_feed/newtype_v3/__pycache__/images.cpython-310.pyc +0 -0
- sd_feed/newtype_v3/__pycache__/locs.cpython-310.pyc +0 -0
- sd_feed/newtype_v3/__pycache__/lora.cpython-310.pyc +0 -0
- sd_feed/newtype_v3/__pycache__/lora_types.cpython-310.pyc +0 -0
- sd_feed/newtype_v3/__pycache__/newtype_v3.cpython-310.pyc +0 -0
- sd_feed/newtype_v3/__pycache__/users.cpython-310.pyc +0 -0
- sd_feed/newtype_v3/images.py +0 -279
- sd_feed/newtype_v3/locs.py +0 -10
- sd_feed/newtype_v3/lora.py +0 -32
- sd_feed/newtype_v3/lora_types.py +0 -7
- sd_feed/newtype_v3/newtype_v3.py +0 -293
- sd_feed/newtype_v3/tabs/__init__.py +0 -6
- sd_feed/newtype_v3/tabs/__pycache__/__init__.cpython-310.pyc +0 -0
- sd_feed/newtype_v3/tabs/__pycache__/feed.cpython-310.pyc +0 -0
- sd_feed/newtype_v3/tabs/feed.py +0 -26
- sd_feed/newtype_v3/users.py +0 -48
- sd_feed/newtype_v3/utils/__init__.py +0 -0
- sd_feed/newtype_v3/utils/__pycache__/__init__.cpython-310.pyc +0 -0
- sd_feed/newtype_v3/utils/__pycache__/string_utils.cpython-310.pyc +0 -0
- sd_feed/newtype_v3/utils/string_utils.py +0 -40
- sd_feed/requirements.txt +0 -2
- sd_feed/scripts/__pycache__/main.cpython-310.pyc +0 -0
- sd_feed/scripts/main.py +0 -22
- sd_feed/style.css +0 -625
- sd_feed/user.json +0 -5
sd_feed/.DS_Store
DELETED
|
Binary file (8.2 kB)
|
|
|
sd_feed/.gitignore
DELETED
|
@@ -1,5 +0,0 @@
|
|
| 1 |
-
__pycache__
|
| 2 |
-
pyc
|
| 3 |
-
user.json
|
| 4 |
-
*.pin
|
| 5 |
-
temp.png
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sd_feed/Readme.md
DELETED
|
@@ -1,82 +0,0 @@
|
|
| 1 |
-
## Feed
|
| 2 |
-
<p align="center">
|
| 3 |
-
<img src="assets/feed.png" alt="Filter Images"/>
|
| 4 |
-
</p>
|
| 5 |
-
|
| 6 |
-
- This is a custom extension for AUTOMATIC1111/stable-diffusion-webui.
|
| 7 |
-
- You can enjoy browsing from tab and getting reputation with your pictures
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
[](https://www.youtube.com/watch?v=hq1MMXSYjTQ)
|
| 12 |
-
|
| 13 |
-
### Installation
|
| 14 |
-
- The extension can be installed directly from within the **Extension** tab within the Webui.
|
| 15 |
-
- You can also install it manually by running the following command from within the webui directory:
|
| 16 |
-
|
| 17 |
-
git clone https://github.com/todhm/sd_feed.git
|
| 18 |
-
|
| 19 |
-
and restart your stable-diffusion-webui, then you can see the new tab "Feed", and other features on txt2img tab and img2img tab.
|
| 20 |
-
<p align="center">
|
| 21 |
-
<a href="" rel="noopener">
|
| 22 |
-
<img src="assets/extensions.png" alt="Project logo"></a>
|
| 23 |
-
</p>
|
| 24 |
-
|
| 25 |
-
### Introduction
|
| 26 |
-
- You can **upload** your masterpiece on the Feed Tap.
|
| 27 |
-
- You can press the recommend button on the photos created by others.
|
| 28 |
-
- You can see **Pics Of The Day**(POTD) which is most recommended today.
|
| 29 |
-
- You can easily check the generation data of your favorite photos.
|
| 30 |
-
- You can easily Send your favorite photos to t2i or i2i.
|
| 31 |
-
|
| 32 |
-
### Features
|
| 33 |
-
#### Upload Your Masterpiece!
|
| 34 |
-
<img src="assets/feedsetting1.png" alt="Filter Images"/>
|
| 35 |
-
|
| 36 |
-
Upload your image right after generation!
|
| 37 |
-
|
| 38 |
-
### Feed
|
| 39 |
-
<img src="assets/5ulvww8bblta1.webp" alt="Filter Images"/>
|
| 40 |
-
|
| 41 |
-
Browse People's images!
|
| 42 |
-
|
| 43 |
-
there are four feeds
|
| 44 |
-
- newest : pics of all over the world
|
| 45 |
-
- popular : pics what people like
|
| 46 |
-
- favorite : pics that you pushed like button
|
| 47 |
-
- my pics : that you uploaded
|
| 48 |
-
|
| 49 |
-
### Tweak!
|
| 50 |
-
<img src="assets/lhijrt5lblta1.webp" alt="Filter Images"/>
|
| 51 |
-
|
| 52 |
-
Check the parameters and generate your own!
|
| 53 |
-
|
| 54 |
-
You can easily send to t2i,i2i or Copy the Generation data and also communicate!
|
| 55 |
-
|
| 56 |
-
### Pics Of The Day!📷
|
| 57 |
-
<img src="assets/potd.png" alt="Filter Images"/>
|
| 58 |
-
you can be the king of the day!
|
| 59 |
-
|
| 60 |
-
most popular pic of the day will be exhibited on generation tab!
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
#### Getting Started
|
| 64 |
-
To start using our WebUI Extension for Reputation-Based Feed Sharing, simply install the extension on your browser and create an account. You can then start uploading your feed and browsing other people's feed and prompts.
|
| 65 |
-
|
| 66 |
-
#### Feedback and Support
|
| 67 |
-
We are constantly improving our extension based on user feedback, so please let us know if you have any suggestions or issues. You can contact us at
|
| 68 |
-
|
| 69 |
-
---
|
| 70 |
-
### Warning
|
| 71 |
-
- Your uploaded image might be exposed to our promotion contents.
|
| 72 |
-
- It does not mean we will make a profit from your contents. There is possibility that other people might see your content indirectly when we trying to introduce our feed to other people.
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
### Todo & Further Features.
|
| 76 |
-
|
| 77 |
-
- We want to support a image producers by adding a sponsor features to pouplar images.
|
| 78 |
-
- We also planned to extend community functions by adding comments on each functions.
|
| 79 |
-
- Any suggestions are welcomed. Please leave us your comments.
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sd_feed/assets/5ulvww8bblta1.webp
DELETED
|
Binary file (219 kB)
|
|
|
sd_feed/assets/extensions.png
DELETED
|
Binary file (73.9 kB)
|
|
|
sd_feed/assets/feed.png
DELETED
|
Binary file (8.61 kB)
|
|
|
sd_feed/assets/feedsetting1.png
DELETED
|
Binary file (251 kB)
|
|
|
sd_feed/assets/lhijrt5lblta1.webp
DELETED
|
Binary file (193 kB)
|
|
|
sd_feed/assets/pinterest.png
DELETED
Git LFS Details
|
sd_feed/assets/potd.png
DELETED
|
Binary file (567 kB)
|
|
|
sd_feed/assets/share.png
DELETED
|
Binary file (27.3 kB)
|
|
|
sd_feed/assets/shareandearn.png
DELETED
|
Binary file (52.7 kB)
|
|
|
sd_feed/html/feedtab.html
DELETED
|
@@ -1,291 +0,0 @@
|
|
| 1 |
-
<div class="feed-tab-header" style="display:flex;width:100%;justify-content:space-between;" id="feed-header">
|
| 2 |
-
<div class="feed-tab-class">
|
| 3 |
-
<button
|
| 4 |
-
v-for="(item, index) in modeSelectList"
|
| 5 |
-
:key="index"
|
| 6 |
-
class="feed-tab-default"
|
| 7 |
-
:class="{ 'selected' : item.value === mode}"
|
| 8 |
-
@click="setMode(item.value)"
|
| 9 |
-
>{{ item.name }}</button>
|
| 10 |
-
<button
|
| 11 |
-
class="feed-tab-default"
|
| 12 |
-
:class="{ 'selected' : mode === 'nicknameSearch'}"
|
| 13 |
-
id="feed-user-tab"
|
| 14 |
-
@click="setNicknameSearch">
|
| 15 |
-
</button>
|
| 16 |
-
</div>
|
| 17 |
-
<div class="feed-tab-class-search">
|
| 18 |
-
<input id="prompt-input" type="text" v-model="prompt" @keyup.enter="fetchNewImage" style="margin-right:5px;">
|
| 19 |
-
<button @click="fetchNewImage" id="feed-search-btn">Search</button>
|
| 20 |
-
</div>
|
| 21 |
-
</div>
|
| 22 |
-
<div>
|
| 23 |
-
<div class="product-slider" style="display:flex;justify-content:center;">
|
| 24 |
-
<div style="display:flex;justify-content:flex-end;width:100%;margin-top:20px;">
|
| 25 |
-
<div style="display:flex;">
|
| 26 |
-
<button style="margin-right:20px;" @click="selectRealTag" class="tag-button" :class="{ 'tag-button-selected': realTag, 'tag-button-unselected': !realTag }">REAL</button>
|
| 27 |
-
</div>
|
| 28 |
-
<div style="display:flex;">
|
| 29 |
-
<button style="margin-right:100px;" @click="selectAnimeTag" class="tag-button" :class="{ 'tag-button-selected': animeTag, 'tag-button-unselected': !animeTag }">ILLUST</button>
|
| 30 |
-
</div>
|
| 31 |
-
<div>
|
| 32 |
-
<label class="toggle-btn">
|
| 33 |
-
<span class="toggle-letter">Filter NSFW</span>
|
| 34 |
-
<input type="checkbox" v-model="filterNsfw" @change="fetchNewImage">
|
| 35 |
-
<span class="slider round"></span>
|
| 36 |
-
</label>
|
| 37 |
-
</div>
|
| 38 |
-
</div>
|
| 39 |
-
</div>
|
| 40 |
-
<div class="product-slider" style="display:flex;justify-content:center;" v-if="mode=='nicknameSearch'">
|
| 41 |
-
<div class="page-max-width">
|
| 42 |
-
<div style="max-width:100%;display:flex;align-items: start;">
|
| 43 |
-
<div style="margin-left:37px;margin-right:37px;margin-bottom:37px;">
|
| 44 |
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="160" zoomAndPan="magnify" viewBox="0 0 39 38.999999" height="160" preserveAspectRatio="xMidYMid meet" version="1.0"><rect x="-3.9" width="46.8" fill="#ffffff" y="-3.9" height="46.799999" fill-opacity="1"/><rect x="-3.9" width="46.8" fill="#ffffff" y="-3.9" height="46.799999" fill-opacity="1"/><rect x="-3.9" width="46.8" fill="#ffffff" y="-3.9" height="46.799999" fill-opacity="1"/><path fill="#000000" d="M 33.289062 5.710938 C 29.605469 2.027344 24.707031 0 19.5 0 C 14.292969 0 9.394531 2.027344 5.710938 5.710938 C 2.027344 9.394531 0 14.292969 0 19.5 C 0 24.707031 2.027344 29.605469 5.710938 33.289062 C 9.394531 36.972656 14.292969 39 19.5 39 C 24.707031 39 29.605469 36.972656 33.289062 33.289062 C 36.972656 29.605469 39 24.707031 39 19.5 C 39 14.292969 36.972656 9.394531 33.289062 5.710938 Z M 6.597656 6.597656 C 10.042969 3.148438 14.625 1.25 19.5 1.25 C 24.375 1.25 28.957031 3.148438 32.402344 6.597656 C 35.851562 10.042969 37.746094 14.625 37.746094 19.5 C 37.746094 23.550781 36.433594 27.402344 34.011719 30.566406 C 32.085938 27.871094 29.007812 26.277344 25.664062 26.277344 L 13.335938 26.277344 C 9.992188 26.277344 6.914062 27.871094 4.988281 30.566406 C 2.5625 27.402344 1.25 23.550781 1.25 19.5 C 1.25 14.625 3.148438 10.042969 6.597656 6.597656 Z M 19.5 25.25 C 24.507812 25.25 28.585938 21.171875 28.585938 16.164062 C 28.585938 11.152344 24.507812 7.078125 19.5 7.078125 C 14.488281 7.078125 10.414062 11.152344 10.414062 16.164062 C 10.414062 21.171875 14.488281 25.25 19.5 25.25 Z M 19.5 25.25 " fill-opacity="1" fill-rule="nonzero"/></svg>
|
| 45 |
-
</div>
|
| 46 |
-
<div>
|
| 47 |
-
<div style="display:flex;align-items:center;">
|
| 48 |
-
<div style="padding: 10px; border-radius: 5px; display:flex;align-items:center;">
|
| 49 |
-
<p style="line-height:normal;line-height:0;font-size: 25px;font-weight: 800;margin-right: 10px;">By.</p>
|
| 50 |
-
<p style="line-height: 0;font-size: 20px;margin-right: 10p;">{{searchNickname}}</p>
|
| 51 |
-
</div>
|
| 52 |
-
</div>
|
| 53 |
-
<div v-html="parsedSearchProfile" style="padding: 10px; border-radius: 5px; display:flex;align-items:center;">
|
| 54 |
-
|
| 55 |
-
</div>
|
| 56 |
-
</div>
|
| 57 |
-
</div>
|
| 58 |
-
</div>
|
| 59 |
-
</div>
|
| 60 |
-
<div class="product-slider" style="display:flex;justify-content:center;" v-if="mode=='private'">
|
| 61 |
-
<div class="page-max-width">
|
| 62 |
-
<div style="max-width:100%;display:flex;align-items: start;">
|
| 63 |
-
<div style="margin-left:37px;margin-right:37px;margin-bottom:37px;">
|
| 64 |
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="160" zoomAndPan="magnify" viewBox="0 0 39 38.999999" height="160" preserveAspectRatio="xMidYMid meet" version="1.0"><rect x="-3.9" width="46.8" fill="#ffffff" y="-3.9" height="46.799999" fill-opacity="1"/><rect x="-3.9" width="46.8" fill="#ffffff" y="-3.9" height="46.799999" fill-opacity="1"/><rect x="-3.9" width="46.8" fill="#ffffff" y="-3.9" height="46.799999" fill-opacity="1"/><path fill="#000000" d="M 33.289062 5.710938 C 29.605469 2.027344 24.707031 0 19.5 0 C 14.292969 0 9.394531 2.027344 5.710938 5.710938 C 2.027344 9.394531 0 14.292969 0 19.5 C 0 24.707031 2.027344 29.605469 5.710938 33.289062 C 9.394531 36.972656 14.292969 39 19.5 39 C 24.707031 39 29.605469 36.972656 33.289062 33.289062 C 36.972656 29.605469 39 24.707031 39 19.5 C 39 14.292969 36.972656 9.394531 33.289062 5.710938 Z M 6.597656 6.597656 C 10.042969 3.148438 14.625 1.25 19.5 1.25 C 24.375 1.25 28.957031 3.148438 32.402344 6.597656 C 35.851562 10.042969 37.746094 14.625 37.746094 19.5 C 37.746094 23.550781 36.433594 27.402344 34.011719 30.566406 C 32.085938 27.871094 29.007812 26.277344 25.664062 26.277344 L 13.335938 26.277344 C 9.992188 26.277344 6.914062 27.871094 4.988281 30.566406 C 2.5625 27.402344 1.25 23.550781 1.25 19.5 C 1.25 14.625 3.148438 10.042969 6.597656 6.597656 Z M 19.5 25.25 C 24.507812 25.25 28.585938 21.171875 28.585938 16.164062 C 28.585938 11.152344 24.507812 7.078125 19.5 7.078125 C 14.488281 7.078125 10.414062 11.152344 10.414062 16.164062 C 10.414062 21.171875 14.488281 25.25 19.5 25.25 Z M 19.5 25.25 " fill-opacity="1" fill-rule="nonzero"/></svg>
|
| 65 |
-
</div>
|
| 66 |
-
<template v-if="!editMode">
|
| 67 |
-
<div>
|
| 68 |
-
<div style="display:flex;align-items:center;">
|
| 69 |
-
<div style="padding: 10px; border-radius: 5px; display:flex;align-items:center;">
|
| 70 |
-
<p style="line-height:normal;line-height:0;font-size: 25px;font-weight: 800;margin-right: 10px;">By.</p>
|
| 71 |
-
<p style="line-height: 0;font-size: 20px;margin-right: 10p;">{{nickname}}</p>
|
| 72 |
-
</div>
|
| 73 |
-
<button @click="setEditMode" style="width:24px;height:24px;">
|
| 74 |
-
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit-2"><path d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path></svg>
|
| 75 |
-
</button>
|
| 76 |
-
</div>
|
| 77 |
-
<div style="padding: 10px; border-radius: 5px; display:flex;align-items:center;" v-html="parsedProfile">
|
| 78 |
-
</div>
|
| 79 |
-
<div style="padding: 10px; border-radius: 5px; display:flex;align-items:center;">
|
| 80 |
-
If you have any question or want to modify your data contact us at Discord: #Zag5956
|
| 81 |
-
</div>
|
| 82 |
-
</div>
|
| 83 |
-
</template>
|
| 84 |
-
<template v-else>
|
| 85 |
-
<div style="width:100%;">
|
| 86 |
-
<div style="width:100%;">
|
| 87 |
-
<input style="padding: 10px; border-radius: 5px; border: 1px solid #ccc; flex-grow: 1;" type="text" v-model="nickname">
|
| 88 |
-
<button style="width:24px;height:24px;margin-right:15px;margin-left:15px;" @click="saveNickname">💾</button>
|
| 89 |
-
<button style="width:24px;height:24px;" @click="setEditMode">
|
| 90 |
-
✖️
|
| 91 |
-
</button>
|
| 92 |
-
</div>
|
| 93 |
-
<div style="width:100%;">
|
| 94 |
-
<textarea v-model="profile" @input="handleTextareaInput" id="profile-writer-type" class="profile-writer-type" placeholder="Type your profile"></textarea>
|
| 95 |
-
</div>
|
| 96 |
-
</div>
|
| 97 |
-
</template>
|
| 98 |
-
</div>
|
| 99 |
-
<div style="display:flex;justify-content:center;" v-if="imageList.length == 0 & mode=='private'" class="private-upload">
|
| 100 |
-
<div style="width:100%;">
|
| 101 |
-
<label for="image-input-file" style="background-color:#AFB6BD;width:100%;aspect-ratio:1/1;">
|
| 102 |
-
<div style="background-color:#AFB6BD;width:100%;aspect-ratio:1/1;display:flex; align-items:center;justify-content:center;">
|
| 103 |
-
<div style="background-color:white;width:80%;aspect-ratio:1/1;display:flex; align-items:center;justify-content:center;">
|
| 104 |
-
<div v-if="!loading">
|
| 105 |
-
<div style="color:#AFB6BD;font-size:18px;display:flex;justify-content:center;">
|
| 106 |
-
Please Upload Image
|
| 107 |
-
</div>
|
| 108 |
-
<div style="color:#AFB6BD;font-size:15px;display:flex;justify-content:center;">-or-</div>
|
| 109 |
-
<div style="color:#AFB6BD;font-size:18px;display:flex;justify-content:center;">Click and upload</div>
|
| 110 |
-
</div>
|
| 111 |
-
<div v-if="loading">
|
| 112 |
-
<div style="color:#AFB6BD;font-size:18px;display:center;justify-content:center;">
|
| 113 |
-
Loading Image...
|
| 114 |
-
</div>
|
| 115 |
-
</div>
|
| 116 |
-
</div>
|
| 117 |
-
</div>
|
| 118 |
-
</label>
|
| 119 |
-
<input
|
| 120 |
-
id="image-input-file"
|
| 121 |
-
type="file"
|
| 122 |
-
multiple
|
| 123 |
-
accept="image/*"
|
| 124 |
-
style="display:none;"
|
| 125 |
-
@change="uploadImage"
|
| 126 |
-
>
|
| 127 |
-
</div>
|
| 128 |
-
</div>
|
| 129 |
-
</div>
|
| 130 |
-
</div>
|
| 131 |
-
<div class="product-slider" v-if="imageList.length > 0">
|
| 132 |
-
<div class="pinterest-column-gallery" id="columns">
|
| 133 |
-
<div v-if="mode=='private'" class="pinterest-column-item">
|
| 134 |
-
<label for="image-input-file" style="background-color:#AFB6BD;width:100%;aspect-ratio:1/1;">
|
| 135 |
-
<div style="background-color:#AFB6BD;width:100%;aspect-ratio:1/1;display:flex; align-items:center;justify-content:center;">
|
| 136 |
-
<div style="background-color:white;width:80%;aspect-ratio:1/1;display:flex; align-items:center;justify-content:center;">
|
| 137 |
-
<div v-if="!uploadLoading">
|
| 138 |
-
<div style="color:#AFB6BD;font-size:18px;display:flex;justify-content:center;">
|
| 139 |
-
Please Upload Image
|
| 140 |
-
</div>
|
| 141 |
-
<div style="color:#AFB6BD;font-size:15px;display:flex;justify-content:center;">-or-</div>
|
| 142 |
-
<div style="color:#AFB6BD;font-size:18px;display:flex;justify-content:center;">Click and upload</div>
|
| 143 |
-
</div>
|
| 144 |
-
<div v-if="uploadLoading">
|
| 145 |
-
<div style="color:#AFB6BD;font-size:18px;display:center;justify-content:center;">
|
| 146 |
-
Loading Image...
|
| 147 |
-
</div>
|
| 148 |
-
</div>
|
| 149 |
-
</div>
|
| 150 |
-
</div>
|
| 151 |
-
</label>
|
| 152 |
-
<input
|
| 153 |
-
id="image-input-file"
|
| 154 |
-
type="file"
|
| 155 |
-
multiple
|
| 156 |
-
accept="image/*"
|
| 157 |
-
style="display:none;"
|
| 158 |
-
@change="uploadImage"
|
| 159 |
-
>
|
| 160 |
-
</div>
|
| 161 |
-
<template v-for="(imageData, j) in sortedDataList" :key="j">
|
| 162 |
-
<div class="pinterest-column-item">
|
| 163 |
-
<img :src="imageData.url" @click="openModal(imageData)">
|
| 164 |
-
<div class="item-overlay">
|
| 165 |
-
<div style="display:flex;align-items: center;height:100%;">
|
| 166 |
-
<template v-if="!imageData.liked">
|
| 167 |
-
<div class="liked-button-div not-liked-div" @click="addToWishList(imageData)">
|
| 168 |
-
<button class="like-button">👍 {{formatNumber(imageData.likecount)}}</button>
|
| 169 |
-
</div>
|
| 170 |
-
</template>
|
| 171 |
-
<template v-else>
|
| 172 |
-
<div class="liked-button-div already-liked-div" @click="deleteWishList(imageData)">
|
| 173 |
-
<button class="like-button already-liked-button">👍 {{formatNumber(imageData.likecount)}}</button>
|
| 174 |
-
</div>
|
| 175 |
-
</template>
|
| 176 |
-
<div style="
|
| 177 |
-
display: flex;
|
| 178 |
-
justify-content: center;
|
| 179 |
-
align-items: center;
|
| 180 |
-
margin-left:5px;
|
| 181 |
-
height:100%;
|
| 182 |
-
">
|
| 183 |
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" zoomAndPan="magnify" viewBox="0 0 39 38.999999" height="20" preserveAspectRatio="xMidYMid meet" version="1.0"><defs><clipPath id="a06d7ef085"><path d="M 1.484375 7.214844 L 37.484375 7.214844 L 37.484375 31.964844 L 1.484375 31.964844 Z M 1.484375 7.214844 " clip-rule="nonzero"/></clipPath></defs><g clip-path="url(#a06d7ef085)"><path fill="#ffffff" d="M 19.484375 7.214844 C 11.300781 7.214844 4.316406 12.347656 1.484375 19.589844 C 4.316406 26.835938 11.300781 31.964844 19.484375 31.964844 C 27.664062 31.964844 34.652344 26.835938 37.484375 19.589844 C 34.652344 12.347656 27.671875 7.214844 19.484375 7.214844 Z M 19.484375 27.839844 C 14.96875 27.839844 11.300781 24.144531 11.300781 19.589844 C 11.300781 15.039062 14.96875 11.339844 19.484375 11.339844 C 24 11.339844 27.664062 15.039062 27.664062 19.589844 C 27.664062 24.144531 24 27.839844 19.484375 27.839844 Z M 19.484375 14.640625 C 16.777344 14.640625 14.574219 16.859375 14.574219 19.589844 C 14.574219 22.320312 16.777344 24.539062 19.484375 24.539062 C 22.191406 24.539062 24.394531 22.320312 24.394531 19.589844 C 24.394531 16.859375 22.191406 14.640625 19.484375 14.640625 Z M 19.484375 14.640625 " fill-opacity="1" fill-rule="nonzero"/></g></svg>
|
| 184 |
-
</div>
|
| 185 |
-
<div style="display:flex;justify-content: center;align-items: center;color:white;">
|
| 186 |
-
{{formatNumber(imageData.total_clicks)}}
|
| 187 |
-
</div>
|
| 188 |
-
<div style="display: flex;justify-content: center;align-items: center;margin-left:5px;height:100%;">
|
| 189 |
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" zoomAndPan="magnify" viewBox="0 0 39 38.999999" height="16" preserveAspectRatio="xMidYMid meet" version="1.0"><defs><clipPath id="6d2be58645"><path d="M 2.515625 24 L 36.265625 24 L 36.265625 39 L 2.515625 39 Z M 2.515625 24 " clip-rule="nonzero"/></clipPath></defs><path fill="#ffffff" d="M 19.453125 0.21875 C 18.429688 0.21875 17.601562 1.054688 17.601562 2.085938 L 17.601562 22.101562 L 13.253906 17.730469 C 11.507812 16.023438 8.933594 18.601562 10.632812 20.367188 C 10.632812 20.367188 18.144531 27.925781 18.144531 27.925781 C 18.84375 28.65625 20.0625 28.632812 20.765625 27.925781 C 20.765625 27.925781 28.277344 20.367188 28.277344 20.367188 C 29.96875 18.605469 27.410156 16.023438 25.652344 17.730469 C 25.652344 17.730469 21.308594 22.101562 21.308594 22.101562 L 21.308594 2.085938 C 21.308594 1.054688 20.476562 0.21875 19.453125 0.21875 Z M 19.453125 0.21875 " fill-opacity="1" fill-rule="nonzero"/><g clip-path="url(#6d2be58645)"><path fill="#ffffff" d="M 4.433594 24.738281 C 3.410156 24.738281 2.578125 25.574219 2.578125 26.605469 L 2.578125 29.359375 C 2.578125 34.554688 6.78125 38.78125 11.945312 38.78125 L 26.964844 38.78125 C 32.128906 38.78125 36.328125 34.554688 36.328125 29.359375 L 36.328125 26.605469 C 36.328125 25.574219 35.5 24.738281 34.476562 24.738281 C 33.453125 24.738281 32.621094 25.574219 32.621094 26.605469 L 32.621094 29.359375 C 32.621094 32.496094 30.082031 35.050781 26.964844 35.050781 L 11.945312 35.050781 C 8.824219 35.050781 6.289062 32.496094 6.289062 29.359375 L 6.289062 26.605469 C 6.289062 25.574219 5.457031 24.738281 4.433594 24.738281 Z M 4.433594 24.738281 " fill-opacity="1" fill-rule="nonzero"/></g></svg>
|
| 190 |
-
</div>
|
| 191 |
-
<div style="display:flex;justify-content: center;align-items: center;color:white;">
|
| 192 |
-
{{formatNumber(imageData.total_sendto)}}
|
| 193 |
-
</div>
|
| 194 |
-
<div style="display: flex;justify-content: center;align-items: center;margin-left:5px;height:100%;">
|
| 195 |
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" zoomAndPan="magnify" viewBox="0 0 39 38.999999" height="20" preserveAspectRatio="xMidYMid meet" version="1.0"><defs><clipPath id="ae37d71e45"><path d="M 5.074219 5.542969 L 33.574219 5.542969 L 33.574219 33.292969 L 5.074219 33.292969 Z M 5.074219 5.542969 " clip-rule="nonzero"/></clipPath></defs><g clip-path="url(#ae37d71e45)"><path fill="#ffffff" d="M 11.796875 33.273438 C 11.722656 33.273438 11.648438 33.253906 11.582031 33.21875 C 11.4375 33.136719 11.347656 32.988281 11.347656 32.820312 L 11.347656 28.015625 L 9.152344 28.015625 C 6.902344 28.015625 5.074219 26.171875 5.074219 23.90625 L 5.074219 9.671875 C 5.074219 7.410156 6.902344 5.566406 9.152344 5.566406 L 29.492188 5.566406 C 31.742188 5.566406 33.570312 7.410156 33.570312 9.671875 L 33.570312 23.90625 C 33.570312 26.171875 31.742188 28.015625 29.492188 28.015625 L 20.226562 28.015625 C 17.496094 29.746094 14.765625 31.472656 12.035156 33.203125 C 11.964844 33.25 11.878906 33.273438 11.796875 33.273438 Z M 11.796875 33.273438 " fill-opacity="1" fill-rule="nonzero"/></g></svg>
|
| 196 |
-
</div>
|
| 197 |
-
<div style="display:flex;justify-content: center;align-items: center;color:white;">
|
| 198 |
-
{{formatNumber(imageData.total_comments)}}
|
| 199 |
-
</div>
|
| 200 |
-
</div>
|
| 201 |
-
<div style="display:flex;align-items:center;">
|
| 202 |
-
<a class="item-author" @click="moveFeedProfileTab(imageData.nickname)" href="javascript:void(0);">by {{imageData.nickname}}</a>
|
| 203 |
-
</div>
|
| 204 |
-
</div>
|
| 205 |
-
</template>
|
| 206 |
-
</div>
|
| 207 |
-
</div>
|
| 208 |
-
</div>
|
| 209 |
-
<template v-if="this.showModal">
|
| 210 |
-
<div class="promptModal">
|
| 211 |
-
<div class="prompt-modal-page">
|
| 212 |
-
<div class="prompt-modal-image" @click="closeOutsideModal">
|
| 213 |
-
<img :src="src" alt="Pretty Image" class="prompt-modal-image-tag"/>
|
| 214 |
-
</div>
|
| 215 |
-
<div class="prompt-modal-sidebar">
|
| 216 |
-
<div class="modal-sidebar-header">
|
| 217 |
-
<div style="display:flex;">
|
| 218 |
-
<div class="modal-like-wrapper">
|
| 219 |
-
<template v-if="!currentItem.liked">
|
| 220 |
-
<div class="big-liked-button-div not-liked-div" @click="addToWishList(currentItem)">
|
| 221 |
-
<button class="like-button">👍 {{formatNumber(currentItem.likecount)}}</button>
|
| 222 |
-
</div>
|
| 223 |
-
</template>
|
| 224 |
-
<template v-else>
|
| 225 |
-
<div class="big-liked-button-div already-liked-div" @click="deleteWishList(currentItem)">
|
| 226 |
-
<button class="like-button already-liked-button">👍 {{formatNumber(currentItem.likecount)}}</button>
|
| 227 |
-
</div>
|
| 228 |
-
</template>
|
| 229 |
-
</div>
|
| 230 |
-
<div class="modal-writer-wrappers">
|
| 231 |
-
<a href="javascript:void(0);" @click="moveFeedProfileTab(currentItem.nickname)" class="modal-writer">By {{currentItem.nickname}}</a>
|
| 232 |
-
<div class="modal-writer-time">{{currentItem.created_at}}</div>
|
| 233 |
-
</div>
|
| 234 |
-
</div>
|
| 235 |
-
<div class="modal-writer-wrapper-exit" @click="close()">
|
| 236 |
-
<div>
|
| 237 |
-
<svg xmlns="http://www.w3.org/2000/svg" width="35" height="35" viewBox="0 0 35 35" fill="none">
|
| 238 |
-
<path d="M19.9037 17.8831L27.752 25.7314V27.7998H25.6837L17.8354 19.9514L9.98703 27.7998H7.9187V25.7314L15.767 17.8831L7.9187 10.0348V7.96643H9.98703L17.8354 15.8148L25.6837 7.96643H27.752V10.0348L19.9037 17.8831Z" fill="white"/>
|
| 239 |
-
<rect x="1.32679" y="1.37439" width="33.0173" height="33.0173" rx="4.50866" stroke="#0E0E0E" stroke-width="0.982675"/>
|
| 240 |
-
</svg>
|
| 241 |
-
</div>
|
| 242 |
-
</div>
|
| 243 |
-
</div>
|
| 244 |
-
<div class="modal-write-input-wrapper">
|
| 245 |
-
<div class="modal-write-input-div">
|
| 246 |
-
<textarea v-model="comment" @input="handleTextareaInput" id="modal-writer-type" class="modal-writer-type" @focus="makeSaveButtonVisible" placeholder="Type your comment"></textarea>
|
| 247 |
-
</div>
|
| 248 |
-
<div style="display:flex;justify-content:center;width:100%;">
|
| 249 |
-
<div v-if="showCommentWrite" class="write-row-button">
|
| 250 |
-
<button class="btn-write-row btn-cancel" @click="hideSaveButtonVisible">Cancel</button>
|
| 251 |
-
<button class="btn-write-row btn-save" @click="writeComment()">Comment</button>
|
| 252 |
-
</div>
|
| 253 |
-
</div>
|
| 254 |
-
</div>
|
| 255 |
-
<div style="margin-top:10px;border-bottom: 1px solid #AFB6BD;padding-bottom:17px;">
|
| 256 |
-
<template v-for="(commentData, j) in comments" :key="j">
|
| 257 |
-
<div style="margin-left:10px;margin-right:10px;">
|
| 258 |
-
<div style="display:flex;width:100%;margin-bottom:12px;color:white;">
|
| 259 |
-
<div style="margin-right:10px;color:white;font-size:17px;font-weight:700;">{{commentData.user.nickname}}</div>
|
| 260 |
-
<div style="color:white;font-size:12px;font-weight:300;">{{commentData.created_at}}</div>
|
| 261 |
-
</div>
|
| 262 |
-
<div style="display:flex;width:100%;color:white;">
|
| 263 |
-
<div style="color:white;font-size:13px;">{{commentData.text}}</div>
|
| 264 |
-
</div>
|
| 265 |
-
</div>
|
| 266 |
-
</template>
|
| 267 |
-
</div>
|
| 268 |
-
<div class="prompt-send-to">
|
| 269 |
-
<button class="btn-send-to btn-send-to-text" @click="this.sendToTextToImage()">Send to t2i</button>
|
| 270 |
-
<button class="btn-send-to btn-send-to-img" @click="this.sendToImageToImage()">Send to i2i</button>
|
| 271 |
-
</div>
|
| 272 |
-
<div style="margin-top:12px;">
|
| 273 |
-
<div style="margin-left: 10px;margin-right: 10px;">
|
| 274 |
-
<div style="color:white;margin-bottom:12px;">Generation Data</div>
|
| 275 |
-
<div style="box-sizing: border-box;display: flex;flex-direction: column;justify-content: center;align-items: flex-start;padding-left:20px;padding-right:20px;padding-top:10px;padding-bottom:10px;border: 1px solid #AFB6BD;border-radius: 5px;color:white;">
|
| 276 |
-
<template v-for="(value, key) in metadata">
|
| 277 |
-
<template v-if="/^[A-Z]/.test(key)">
|
| 278 |
-
{{key}}:{{value}},
|
| 279 |
-
</template>
|
| 280 |
-
</template>
|
| 281 |
-
</div>
|
| 282 |
-
<div style="display:flex;justify-content:center;margin-top:20px;">
|
| 283 |
-
<button @click="copyClipboard" style="text-align:center;box-sizing: border-box;display: flex;flex-direction: column;justify-content: center;align-items: flex-start;padding-top:10px;padding-bottom:10px;border: 1px solid #AFB6BD;border-radius: 5px;color:white;width:100%;">
|
| 284 |
-
<div style="color:white;margin:auto;">Copy Generation Data</div></button>
|
| 285 |
-
</div>
|
| 286 |
-
</div>
|
| 287 |
-
</div>
|
| 288 |
-
</div>
|
| 289 |
-
</div>
|
| 290 |
-
</div>
|
| 291 |
-
</template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
@@ -1,24 +0,0 @@
|
|
| 1 |
-
<div class="feed-tab-header" style="display:flex;width:100%;justify-content:space-between;" id="lora-search-table">
|
| 2 |
-
<input value="" id="lora-download-url" style="display:none;"/>
|
| 3 |
-
<input value="" id="lora-filename" style="display:none;"/>
|
| 4 |
-
<table v-if="loraList.length>0">
|
| 5 |
-
<thead>
|
| 6 |
-
<th>File Name</th>
|
| 7 |
-
<th></th>
|
| 8 |
-
</thead>
|
| 9 |
-
<tbody>
|
| 10 |
-
<template v-for="(loraData, j) in loraList" :key="j">
|
| 11 |
-
<tr>
|
| 12 |
-
<td>{{loraData.fileName}}</td>
|
| 13 |
-
<template v-if="loraData.downloadUrl != ''">
|
| 14 |
-
<td><button @click="setUrlData(loraData.downloadUrl, loraData.fileName)">Download</button></td>
|
| 15 |
-
</template>
|
| 16 |
-
<template v-else>
|
| 17 |
-
<td>Not Found OTL</td>
|
| 18 |
-
</template>
|
| 19 |
-
</tr>
|
| 20 |
-
</template>
|
| 21 |
-
|
| 22 |
-
</tbody>
|
| 23 |
-
</table>
|
| 24 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sd_feed/html/potd.html
DELETED
|
@@ -1,135 +0,0 @@
|
|
| 1 |
-
<div>
|
| 2 |
-
<div style="display: flex;justify-content: space-between;">
|
| 3 |
-
<div class="potd">
|
| 4 |
-
👑 POTD 👑
|
| 5 |
-
</div>
|
| 6 |
-
<div>
|
| 7 |
-
<label class="toggle-btn">
|
| 8 |
-
<span class="toggle-letter">Filter NSFW</span>
|
| 9 |
-
<input type="checkbox" v-model="filterNsfw" @change="fetchBests">
|
| 10 |
-
<span class="slider round"></span>
|
| 11 |
-
</label>
|
| 12 |
-
</div>
|
| 13 |
-
</div>
|
| 14 |
-
<div class="product-slider" v-if="bestFeeds.length > 0">
|
| 15 |
-
<div class="pinterest-gallery">
|
| 16 |
-
<template v-for="(imageData, j) in bestFeeds" :key="j">
|
| 17 |
-
<div class="pinterest-item">
|
| 18 |
-
<button @click="openModal(imageData)">
|
| 19 |
-
<img :src="imageData.url">
|
| 20 |
-
</button>
|
| 21 |
-
<div class="item-overlay">
|
| 22 |
-
<div style="display:flex;align-items: center;height:100%;">
|
| 23 |
-
<template v-if="!imageData.liked">
|
| 24 |
-
<div class="liked-button-div not-liked-div" @click="addToWishList(imageData)">
|
| 25 |
-
<button class="like-button">👍 {{formatNumber(imageData.likecount)}}</button>
|
| 26 |
-
</div>
|
| 27 |
-
</template>
|
| 28 |
-
<template v-else>
|
| 29 |
-
<div class="liked-button-div already-liked-div" @click="deleteWishList(imageData)">
|
| 30 |
-
<button class="like-button already-liked-button">👍 {{formatNumber(imageData.likecount)}}</button>
|
| 31 |
-
</div>
|
| 32 |
-
</template>
|
| 33 |
-
<div style="display: flex;justify-content: center;align-items: center;margin-left:5px;height:100%;">
|
| 34 |
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="12" zoomAndPan="magnify" viewBox="0 0 39 38.999999" height="12" preserveAspectRatio="xMidYMid meet" version="1.0"><defs><clipPath id="6d2be58645"><path d="M 2.515625 24 L 36.265625 24 L 36.265625 39 L 2.515625 39 Z M 2.515625 24 " clip-rule="nonzero"/></clipPath></defs><path fill="#ffffff" d="M 19.453125 0.21875 C 18.429688 0.21875 17.601562 1.054688 17.601562 2.085938 L 17.601562 22.101562 L 13.253906 17.730469 C 11.507812 16.023438 8.933594 18.601562 10.632812 20.367188 C 10.632812 20.367188 18.144531 27.925781 18.144531 27.925781 C 18.84375 28.65625 20.0625 28.632812 20.765625 27.925781 C 20.765625 27.925781 28.277344 20.367188 28.277344 20.367188 C 29.96875 18.605469 27.410156 16.023438 25.652344 17.730469 C 25.652344 17.730469 21.308594 22.101562 21.308594 22.101562 L 21.308594 2.085938 C 21.308594 1.054688 20.476562 0.21875 19.453125 0.21875 Z M 19.453125 0.21875 " fill-opacity="1" fill-rule="nonzero"/><g clip-path="url(#6d2be58645)"><path fill="#ffffff" d="M 4.433594 24.738281 C 3.410156 24.738281 2.578125 25.574219 2.578125 26.605469 L 2.578125 29.359375 C 2.578125 34.554688 6.78125 38.78125 11.945312 38.78125 L 26.964844 38.78125 C 32.128906 38.78125 36.328125 34.554688 36.328125 29.359375 L 36.328125 26.605469 C 36.328125 25.574219 35.5 24.738281 34.476562 24.738281 C 33.453125 24.738281 32.621094 25.574219 32.621094 26.605469 L 32.621094 29.359375 C 32.621094 32.496094 30.082031 35.050781 26.964844 35.050781 L 11.945312 35.050781 C 8.824219 35.050781 6.289062 32.496094 6.289062 29.359375 L 6.289062 26.605469 C 6.289062 25.574219 5.457031 24.738281 4.433594 24.738281 Z M 4.433594 24.738281 " fill-opacity="1" fill-rule="nonzero"/></g></svg>
|
| 35 |
-
</div>
|
| 36 |
-
<div style="display:flex;justify-content: center;align-items: center;color:white;">
|
| 37 |
-
{{formatNumber(imageData.total_sendto)}}
|
| 38 |
-
</div>
|
| 39 |
-
<div style="display: flex;justify-content: center;align-items: center;margin-left:5px;height:100%;">
|
| 40 |
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" zoomAndPan="magnify" viewBox="0 0 39 38.999999" height="20" preserveAspectRatio="xMidYMid meet" version="1.0"><defs><clipPath id="ae37d71e45"><path d="M 5.074219 5.542969 L 33.574219 5.542969 L 33.574219 33.292969 L 5.074219 33.292969 Z M 5.074219 5.542969 " clip-rule="nonzero"/></clipPath></defs><g clip-path="url(#ae37d71e45)"><path fill="#ffffff" d="M 11.796875 33.273438 C 11.722656 33.273438 11.648438 33.253906 11.582031 33.21875 C 11.4375 33.136719 11.347656 32.988281 11.347656 32.820312 L 11.347656 28.015625 L 9.152344 28.015625 C 6.902344 28.015625 5.074219 26.171875 5.074219 23.90625 L 5.074219 9.671875 C 5.074219 7.410156 6.902344 5.566406 9.152344 5.566406 L 29.492188 5.566406 C 31.742188 5.566406 33.570312 7.410156 33.570312 9.671875 L 33.570312 23.90625 C 33.570312 26.171875 31.742188 28.015625 29.492188 28.015625 L 20.226562 28.015625 C 17.496094 29.746094 14.765625 31.472656 12.035156 33.203125 C 11.964844 33.25 11.878906 33.273438 11.796875 33.273438 Z M 11.796875 33.273438 " fill-opacity="1" fill-rule="nonzero"/></g></svg>
|
| 41 |
-
</div>
|
| 42 |
-
<div style="display:flex;justify-content: center;align-items: center;color:white;">
|
| 43 |
-
{{formatNumber(imageData.total_comments)}}
|
| 44 |
-
</div>
|
| 45 |
-
</div>
|
| 46 |
-
<div style="display:flex;align-items:center;">
|
| 47 |
-
<a href="javascript:void(0);" target="_self" @click="(e)=>moveFeedProfileTab(e,imageData.nickname)" class="item-author">by {{imageData.nickname}}</a>
|
| 48 |
-
</div>
|
| 49 |
-
</div>
|
| 50 |
-
</div>
|
| 51 |
-
</template>
|
| 52 |
-
</div>
|
| 53 |
-
</div>
|
| 54 |
-
<div :class="{promptModal: showModal}" v-if="showModal">
|
| 55 |
-
<div class="prompt-modal-page">
|
| 56 |
-
<div class="prompt-modal-image" @click="closeOutsideModal">
|
| 57 |
-
<img :src="src" alt="Pretty Image" class="prompt-modal-image-tag"/>
|
| 58 |
-
</div>
|
| 59 |
-
<div class="prompt-modal-sidebar">
|
| 60 |
-
<div class="modal-sidebar-header">
|
| 61 |
-
<div style="display:flex;">
|
| 62 |
-
<div class="modal-like-wrapper">
|
| 63 |
-
<template v-if="!currentItem.liked">
|
| 64 |
-
<div class="big-liked-button-div not-liked-div" @click="addToWishList(currentItem)">
|
| 65 |
-
<button class="like-button">👍 {{formatNumber(currentItem.likecount)}}</button>
|
| 66 |
-
</div>
|
| 67 |
-
</template>
|
| 68 |
-
<template v-else>
|
| 69 |
-
<div class="big-liked-button-div already-liked-div" @click="deleteWishList(currentItem)">
|
| 70 |
-
<button class="like-button already-liked-button">👍 {{formatNumber(currentItem.likecount)}}</button>
|
| 71 |
-
</div>
|
| 72 |
-
</template>
|
| 73 |
-
</div>
|
| 74 |
-
<div class="modal-writer-wrappers">
|
| 75 |
-
<a class="modal-writer" href="javascript:void(0);" target="_self" @click="(e)=>moveFeedProfileTab(e,currentItem.nickname)">By {{currentItem.nickname}}</a>
|
| 76 |
-
<div class="modal-writer-time">{{currentItem.created_at}}</div>
|
| 77 |
-
</div>
|
| 78 |
-
</div>
|
| 79 |
-
<div class="modal-writer-wrapper-exit" @click="close()">
|
| 80 |
-
<div>
|
| 81 |
-
<svg xmlns="http://www.w3.org/2000/svg" width="35" height="35" viewBox="0 0 35 35" fill="none">
|
| 82 |
-
<path d="M19.9037 17.8831L27.752 25.7314V27.7998H25.6837L17.8354 19.9514L9.98703 27.7998H7.9187V25.7314L15.767 17.8831L7.9187 10.0348V7.96643H9.98703L17.8354 15.8148L25.6837 7.96643H27.752V10.0348L19.9037 17.8831Z" fill="white"/>
|
| 83 |
-
<rect x="1.32679" y="1.37439" width="33.0173" height="33.0173" rx="4.50866" stroke="#0E0E0E" stroke-width="0.982675"/>
|
| 84 |
-
</svg>
|
| 85 |
-
</div>
|
| 86 |
-
</div>
|
| 87 |
-
</div>
|
| 88 |
-
<div class="modal-write-input-wrapper">
|
| 89 |
-
<div class="modal-write-input-div">
|
| 90 |
-
<textarea v-model="comment" @input="handleTextareaInput" id="modal-writer-type" class="modal-writer-type" @focus="makeSaveButtonVisible" placeholder="Type your comment"></textarea>
|
| 91 |
-
</div>
|
| 92 |
-
<div style="display:flex;justify-content:center;width:100%;">
|
| 93 |
-
<div v-if="showCommentWrite" class="write-row-button">
|
| 94 |
-
<button class="btn-write-row btn-cancel" @click="hideSaveButtonVisible">Cancel</button>
|
| 95 |
-
<button class="btn-write-row btn-save" @click="writeComment()">Comment</button>
|
| 96 |
-
/ </div>
|
| 97 |
-
</div>
|
| 98 |
-
</div>
|
| 99 |
-
<div style="margin-top:10px;border-bottom: 1px solid #AFB6BD;padding-bottom:17px;">
|
| 100 |
-
<template v-for="(commentData, j) in comments" :key="j">
|
| 101 |
-
<div style="margin-left:10px;margin-right:10px;">
|
| 102 |
-
<div style="display:flex;width:100%;margin-bottom:12px;color:white;">
|
| 103 |
-
<div style="margin-right:10px;color:white;font-size:17px;font-weight:700;">{{commentData.user.nickname}}</div>
|
| 104 |
-
<div style="color:white;font-size:12px;font-weight:300;">{{commentData.created_at}}</div>
|
| 105 |
-
</div>
|
| 106 |
-
<div style="display:flex;width:100%;color:white;">
|
| 107 |
-
<div style="color:white;font-size:13px;">{{commentData.text}}</div>
|
| 108 |
-
</div>
|
| 109 |
-
</div>
|
| 110 |
-
</template>
|
| 111 |
-
</div>
|
| 112 |
-
<div class="prompt-send-to">
|
| 113 |
-
<button class="btn-send-to btn-send-to-text" @click="this.sendToTextToImage()">Send to t2i</button>
|
| 114 |
-
<button class="btn-send-to btn-send-to-img" @click="this.sendToImageToImage()">Send to i2i</button>
|
| 115 |
-
</div>
|
| 116 |
-
<div style="margin-top:12px;">
|
| 117 |
-
<div style="margin-left: 10px;margin-right: 10px;">
|
| 118 |
-
<div style="color:white;margin-bottom:12px;">Generation Data</div>
|
| 119 |
-
<div style="box-sizing: border-box;display: flex;flex-direction: column;justify-content: center;align-items: flex-start;padding-left:20px;padding-right:20px;padding-top:10px;padding-bottom:10px;border: 1px solid #AFB6BD;border-radius: 5px;color:white;">
|
| 120 |
-
<template v-for="(value, key) in metadata">
|
| 121 |
-
<template v-if="/^[A-Z]/.test(key)">
|
| 122 |
-
{{key}}:{{value}},
|
| 123 |
-
</template>
|
| 124 |
-
</template>
|
| 125 |
-
</div>
|
| 126 |
-
<div style="display:flex;justify-content:center;margin-top:20px;">
|
| 127 |
-
<button @click="copyClipboard" style="text-align:center;box-sizing: border-box;display: flex;flex-direction: column;justify-content: center;align-items: flex-start;padding-top:10px;padding-bottom:10px;border: 1px solid #AFB6BD;border-radius: 5px;color:white;width:100%;">
|
| 128 |
-
<div style="color:white;margin:auto;">Copy Generation Data</div></button>
|
| 129 |
-
</div>
|
| 130 |
-
</div>
|
| 131 |
-
</div>
|
| 132 |
-
</div>
|
| 133 |
-
</div>
|
| 134 |
-
</div>
|
| 135 |
-
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sd_feed/html/profile.html
DELETED
|
@@ -1,21 +0,0 @@
|
|
| 1 |
-
<template v-if="!editMode">
|
| 2 |
-
<div style="display:flex;align-items:center;">
|
| 3 |
-
<div style="padding: 10px; border-radius: 5px; display:flex;align-items:center;">
|
| 4 |
-
<p style="line-height:normal;line-height:0;font-size: 25px;font-weight: 800;margin-right: 10px;">By.</p>
|
| 5 |
-
<p style="line-height: 0;font-size: 20px;margin-right: 10p;">{{nickname}}</p>
|
| 6 |
-
</div>
|
| 7 |
-
<div style="padding: 10px; border-radius: 5px; display:flex;align-items:center;">
|
| 8 |
-
<p style="line-height: 0;font-size: 20px;margin-right: 10p;">{{profile}}</p>
|
| 9 |
-
</div>
|
| 10 |
-
<button @click="setEditMode" style="width:24px;height:24px;">
|
| 11 |
-
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit-2"><path d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path></svg>
|
| 12 |
-
</button>
|
| 13 |
-
</div>
|
| 14 |
-
</template>
|
| 15 |
-
<template v-else>
|
| 16 |
-
<input style="padding: 10px; border-radius: 5px; border: 1px solid #ccc; flex-grow: 1;" type="text" v-model="nickname">
|
| 17 |
-
<button style="width:24px;height:24px;margin-right:15px;margin-left:15px;" @click="saveNickname">💾</button>
|
| 18 |
-
<button style="width:24px;height:24px;" @click="setEditMode">
|
| 19 |
-
✖️
|
| 20 |
-
</button>
|
| 21 |
-
</template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sd_feed/install.py
DELETED
|
@@ -1,5 +0,0 @@
|
|
| 1 |
-
import launch
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
if not launch.is_installed("browsercookie"):
|
| 5 |
-
launch.run_pip("install browsercookie", "requirements for Browser Cookie")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sd_feed/javascript/axios.min.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).axios=t()}(this,(function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function r(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,o,i=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return i(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function a(e,t){return function(){return e.apply(t,arguments)}}var s,u=Object.prototype.toString,c=Object.getPrototypeOf,f=(s=Object.create(null),function(e){var t=u.call(e);return s[t]||(s[t]=t.slice(8,-1).toLowerCase())}),l=function(e){return e=e.toLowerCase(),function(t){return f(t)===e}},d=function(t){return function(n){return e(n)===t}},p=Array.isArray,h=d("undefined");var m=l("ArrayBuffer");var y=d("string"),v=d("function"),b=d("number"),g=function(t){return null!==t&&"object"===e(t)},w=function(e){if("object"!==f(e))return!1;var t=c(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},E=l("Date"),O=l("File"),S=l("Blob"),R=l("FileList"),A=l("URLSearchParams");function T(t,n){var r,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=i.allOwnKeys,s=void 0!==a&&a;if(null!=t)if("object"!==e(t)&&(t=[t]),p(t))for(r=0,o=t.length;r<o;r++)n.call(null,t[r],r,t);else{var u,c=s?Object.getOwnPropertyNames(t):Object.keys(t),f=c.length;for(r=0;r<f;r++)u=c[r],n.call(null,t[u],u,t)}}function j(e,t){t=t.toLowerCase();for(var n,r=Object.keys(e),o=r.length;o-- >0;)if(t===(n=r[o]).toLowerCase())return n;return null}var N="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,x=function(e){return!h(e)&&e!==N};var C,P=(C="undefined"!=typeof Uint8Array&&c(Uint8Array),function(e){return C&&e instanceof C}),k=l("HTMLFormElement"),U=function(e){var t=Object.prototype.hasOwnProperty;return function(e,n){return t.call(e,n)}}(),_=l("RegExp"),F=function(e,t){var n=Object.getOwnPropertyDescriptors(e),r={};T(n,(function(n,o){!1!==t(n,o,e)&&(r[o]=n)})),Object.defineProperties(e,r)},B="abcdefghijklmnopqrstuvwxyz",L="0123456789",D={DIGIT:L,ALPHA:B,ALPHA_DIGIT:B+B.toUpperCase()+L};var I={isArray:p,isArrayBuffer:m,isBuffer:function(e){return null!==e&&!h(e)&&null!==e.constructor&&!h(e.constructor)&&v(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:function(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||u.call(e)===t||v(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&m(e.buffer)},isString:y,isNumber:b,isBoolean:function(e){return!0===e||!1===e},isObject:g,isPlainObject:w,isUndefined:h,isDate:E,isFile:O,isBlob:S,isRegExp:_,isFunction:v,isStream:function(e){return g(e)&&v(e.pipe)},isURLSearchParams:A,isTypedArray:P,isFileList:R,forEach:T,merge:function e(){for(var t=x(this)&&this||{},n=t.caseless,r={},o=function(t,o){var i=n&&j(r,o)||o;w(r[i])&&w(t)?r[i]=e(r[i],t):w(t)?r[i]=e({},t):p(t)?r[i]=t.slice():r[i]=t},i=0,a=arguments.length;i<a;i++)arguments[i]&&T(arguments[i],o);return r},extend:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=r.allOwnKeys;return T(t,(function(t,r){n&&v(t)?e[r]=a(t,n):e[r]=t}),{allOwnKeys:o}),e},trim:function(e){return e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,n,r){e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:function(e,t,n,r){var o,i,a,s={};if(t=t||{},null==e)return t;do{for(i=(o=Object.getOwnPropertyNames(e)).length;i-- >0;)a=o[i],r&&!r(a,e,t)||s[a]||(t[a]=e[a],s[a]=!0);e=!1!==n&&c(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:f,kindOfTest:l,endsWith:function(e,t,n){e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return-1!==r&&r===n},toArray:function(e){if(!e)return null;if(p(e))return e;var t=e.length;if(!b(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n},forEachEntry:function(e,t){for(var n,r=(e&&e[Symbol.iterator]).call(e);(n=r.next())&&!n.done;){var o=n.value;t.call(e,o[0],o[1])}},matchAll:function(e,t){for(var n,r=[];null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:k,hasOwnProperty:U,hasOwnProp:U,reduceDescriptors:F,freezeMethods:function(e){F(e,(function(t,n){if(v(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;var r=e[n];v(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=function(){throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:function(e,t){var n={},r=function(e){e.forEach((function(e){n[e]=!0}))};return p(e)?r(e):r(String(e).split(t)),n},toCamelCase:function(e){return e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n}))},noop:function(){},toFiniteNumber:function(e,t){return e=+e,Number.isFinite(e)?e:t},findKey:j,global:N,isContextDefined:x,ALPHABET:D,generateString:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:D.ALPHA_DIGIT,n="",r=t.length;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&v(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:function(e){var t=new Array(10);return function e(n,r){if(g(n)){if(t.indexOf(n)>=0)return;if(!("toJSON"in n)){t[r]=n;var o=p(n)?[]:{};return T(n,(function(t,n){var i=e(t,r+1);!h(i)&&(o[n]=i)})),t[r]=void 0,o}}return n}(e,0)}};function q(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}I.inherits(q,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:I.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var M=q.prototype,z={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((function(e){z[e]={value:e}})),Object.defineProperties(q,z),Object.defineProperty(M,"isAxiosError",{value:!0}),q.from=function(e,t,n,r,o,i){var a=Object.create(M);return I.toFlatObject(e,a,(function(e){return e!==Error.prototype}),(function(e){return"isAxiosError"!==e})),q.call(a,e.message,t,n,r,o),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};function H(e){return I.isPlainObject(e)||I.isArray(e)}function J(e){return I.endsWith(e,"[]")?e.slice(0,-2):e}function W(e,t,n){return e?e.concat(t).map((function(e,t){return e=J(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}var K=I.toFlatObject(I,{},null,(function(e){return/^is[A-Z]/.test(e)}));function V(t,n,r){if(!I.isObject(t))throw new TypeError("target must be an object");n=n||new FormData;var o=(r=I.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!I.isUndefined(t[e])}))).metaTokens,i=r.visitor||f,a=r.dots,s=r.indexes,u=(r.Blob||"undefined"!=typeof Blob&&Blob)&&I.isSpecCompliantForm(n);if(!I.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(I.isDate(e))return e.toISOString();if(!u&&I.isBlob(e))throw new q("Blob is not supported. Use a Buffer instead.");return I.isArrayBuffer(e)||I.isTypedArray(e)?u&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function f(t,r,i){var u=t;if(t&&!i&&"object"===e(t))if(I.endsWith(r,"{}"))r=o?r:r.slice(0,-2),t=JSON.stringify(t);else if(I.isArray(t)&&function(e){return I.isArray(e)&&!e.some(H)}(t)||(I.isFileList(t)||I.endsWith(r,"[]"))&&(u=I.toArray(t)))return r=J(r),u.forEach((function(e,t){!I.isUndefined(e)&&null!==e&&n.append(!0===s?W([r],t,a):null===s?r:r+"[]",c(e))})),!1;return!!H(t)||(n.append(W(i,r,a),c(t)),!1)}var l=[],d=Object.assign(K,{defaultVisitor:f,convertValue:c,isVisitable:H});if(!I.isObject(t))throw new TypeError("data must be an object");return function e(t,r){if(!I.isUndefined(t)){if(-1!==l.indexOf(t))throw Error("Circular reference detected in "+r.join("."));l.push(t),I.forEach(t,(function(t,o){!0===(!(I.isUndefined(t)||null===t)&&i.call(n,t,I.isString(o)?o.trim():o,r,d))&&e(t,r?r.concat(o):[o])})),l.pop()}}(t),n}function G(e){var t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function $(e,t){this._pairs=[],e&&V(e,this,t)}var X=$.prototype;function Q(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Z(e,t,n){if(!t)return e;var r,o=n&&n.encode||Q,i=n&&n.serialize;if(r=i?i(t,n):I.isURLSearchParams(t)?t.toString():new $(t,n).toString(o)){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e}X.append=function(e,t){this._pairs.push([e,t])},X.toString=function(e){var t=e?function(t){return e.call(this,t,G)}:G;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var Y,ee=function(){function e(){t(this,e),this.handlers=[]}return r(e,[{key:"use",value:function(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}},{key:"eject",value:function(e){this.handlers[e]&&(this.handlers[e]=null)}},{key:"clear",value:function(){this.handlers&&(this.handlers=[])}},{key:"forEach",value:function(e){I.forEach(this.handlers,(function(t){null!==t&&e(t)}))}}]),e}(),te={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ne={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:$,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:("undefined"==typeof navigator||"ReactNative"!==(Y=navigator.product)&&"NativeScript"!==Y&&"NS"!==Y)&&"undefined"!=typeof window&&"undefined"!=typeof document,isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function re(e){function t(e,n,r,o){var i=e[o++],a=Number.isFinite(+i),s=o>=e.length;return i=!i&&I.isArray(r)?r.length:i,s?(I.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!a):(r[i]&&I.isObject(r[i])||(r[i]=[]),t(e,n,r[i],o)&&I.isArray(r[i])&&(r[i]=function(e){var t,n,r={},o=Object.keys(e),i=o.length;for(t=0;t<i;t++)r[n=o[t]]=e[n];return r}(r[i])),!a)}if(I.isFormData(e)&&I.isFunction(e.entries)){var n={};return I.forEachEntry(e,(function(e,r){t(function(e){return I.matchAll(/\w+|\[(\w*)]/g,e).map((function(e){return"[]"===e[0]?"":e[1]||e[0]}))}(e),r,n,0)})),n}return null}var oe={"Content-Type":void 0};var ie={transitional:te,adapter:["xhr","http"],transformRequest:[function(e,t){var n,r=t.getContentType()||"",o=r.indexOf("application/json")>-1,i=I.isObject(e);if(i&&I.isHTMLForm(e)&&(e=new FormData(e)),I.isFormData(e))return o&&o?JSON.stringify(re(e)):e;if(I.isArrayBuffer(e)||I.isBuffer(e)||I.isStream(e)||I.isFile(e)||I.isBlob(e))return e;if(I.isArrayBufferView(e))return e.buffer;if(I.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return V(e,new ne.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return ne.isNode&&I.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((n=I.isFileList(e))||r.indexOf("multipart/form-data")>-1){var a=this.env&&this.env.FormData;return V(n?{"files[]":e}:e,a&&new a,this.formSerializer)}}return i||o?(t.setContentType("application/json",!1),function(e,t,n){if(I.isString(e))try{return(t||JSON.parse)(e),I.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||ie.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&I.isString(e)&&(n&&!this.responseType||r)){var o=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(o){if("SyntaxError"===e.name)throw q.from(e,q.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ne.classes.FormData,Blob:ne.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};I.forEach(["delete","get","head"],(function(e){ie.headers[e]={}})),I.forEach(["post","put","patch"],(function(e){ie.headers[e]=I.merge(oe)}));var ae=ie,se=I.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ue=Symbol("internals");function ce(e){return e&&String(e).trim().toLowerCase()}function fe(e){return!1===e||null==e?e:I.isArray(e)?e.map(fe):String(e)}function le(e,t,n,r,o){return I.isFunction(r)?r.call(this,t,n):(o&&(t=n),I.isString(t)?I.isString(r)?-1!==t.indexOf(r):I.isRegExp(r)?r.test(t):void 0:void 0)}var de=function(e,n){function i(e){t(this,i),e&&this.set(e)}return r(i,[{key:"set",value:function(e,t,n){var r=this;function o(e,t,n){var o=ce(t);if(!o)throw new Error("header name must be a non-empty string");var i=I.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||t]=fe(e))}var i,a,s,u,c,f=function(e,t){return I.forEach(e,(function(e,n){return o(e,n,t)}))};return I.isPlainObject(e)||e instanceof this.constructor?f(e,t):I.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?f((c={},(i=e)&&i.split("\n").forEach((function(e){u=e.indexOf(":"),a=e.substring(0,u).trim().toLowerCase(),s=e.substring(u+1).trim(),!a||c[a]&&se[a]||("set-cookie"===a?c[a]?c[a].push(s):c[a]=[s]:c[a]=c[a]?c[a]+", "+s:s)})),c),t):null!=e&&o(t,e,n),this}},{key:"get",value:function(e,t){if(e=ce(e)){var n=I.findKey(this,e);if(n){var r=this[n];if(!t)return r;if(!0===t)return function(e){for(var t,n=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;t=r.exec(e);)n[t[1]]=t[2];return n}(r);if(I.isFunction(t))return t.call(this,r,n);if(I.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}},{key:"has",value:function(e,t){if(e=ce(e)){var n=I.findKey(this,e);return!(!n||void 0===this[n]||t&&!le(0,this[n],n,t))}return!1}},{key:"delete",value:function(e,t){var n=this,r=!1;function o(e){if(e=ce(e)){var o=I.findKey(n,e);!o||t&&!le(0,n[o],o,t)||(delete n[o],r=!0)}}return I.isArray(e)?e.forEach(o):o(e),r}},{key:"clear",value:function(e){for(var t=Object.keys(this),n=t.length,r=!1;n--;){var o=t[n];e&&!le(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}},{key:"normalize",value:function(e){var t=this,n={};return I.forEach(this,(function(r,o){var i=I.findKey(n,o);if(i)return t[i]=fe(r),void delete t[o];var a=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n}))}(o):String(o).trim();a!==o&&delete t[o],t[a]=fe(r),n[a]=!0})),this}},{key:"concat",value:function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return(e=this.constructor).concat.apply(e,[this].concat(n))}},{key:"toJSON",value:function(e){var t=Object.create(null);return I.forEach(this,(function(n,r){null!=n&&!1!==n&&(t[r]=e&&I.isArray(n)?n.join(", "):n)})),t}},{key:Symbol.iterator,value:function(){return Object.entries(this.toJSON())[Symbol.iterator]()}},{key:"toString",value:function(){return Object.entries(this.toJSON()).map((function(e){var t=o(e,2);return t[0]+": "+t[1]})).join("\n")}},{key:Symbol.toStringTag,get:function(){return"AxiosHeaders"}}],[{key:"from",value:function(e){return e instanceof this?e:new this(e)}},{key:"concat",value:function(e){for(var t=new this(e),n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.forEach((function(e){return t.set(e)})),t}},{key:"accessor",value:function(e){var t=(this[ue]=this[ue]={accessors:{}}).accessors,n=this.prototype;function r(e){var r=ce(e);t[r]||(!function(e,t){var n=I.toCamelCase(" "+t);["get","set","has"].forEach((function(r){Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})}))}(n,e),t[r]=!0)}return I.isArray(e)?e.forEach(r):r(e),this}}]),i}();de.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),I.freezeMethods(de.prototype),I.freezeMethods(de);var pe=de;function he(e,t){var n=this||ae,r=t||n,o=pe.from(r.headers),i=r.data;return I.forEach(e,(function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)})),o.normalize(),i}function me(e){return!(!e||!e.__CANCEL__)}function ye(e,t,n){q.call(this,null==e?"canceled":e,q.ERR_CANCELED,t,n),this.name="CanceledError"}I.inherits(ye,q,{__CANCEL__:!0});var ve=ne.isStandardBrowserEnv?{write:function(e,t,n,r,o,i){var a=[];a.push(e+"="+encodeURIComponent(t)),I.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),I.isString(r)&&a.push("path="+r),I.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function be(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var ge=ne.isStandardBrowserEnv?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=I.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0};function we(e,t){var n=0,r=function(e,t){e=e||10;var n,r=new Array(e),o=new Array(e),i=0,a=0;return t=void 0!==t?t:1e3,function(s){var u=Date.now(),c=o[a];n||(n=u),r[i]=s,o[i]=u;for(var f=a,l=0;f!==i;)l+=r[f++],f%=e;if((i=(i+1)%e)===a&&(a=(a+1)%e),!(u-n<t)){var d=c&&u-c;return d?Math.round(1e3*l/d):void 0}}}(50,250);return function(o){var i=o.loaded,a=o.lengthComputable?o.total:void 0,s=i-n,u=r(s);n=i;var c={loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:u||void 0,estimated:u&&a&&i<=a?(a-i)/u:void 0,event:o};c[t?"download":"upload"]=!0,e(c)}}var Ee={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){var r,o=e.data,i=pe.from(e.headers).normalize(),a=e.responseType;function s(){e.cancelToken&&e.cancelToken.unsubscribe(r),e.signal&&e.signal.removeEventListener("abort",r)}I.isFormData(o)&&(ne.isStandardBrowserEnv||ne.isStandardBrowserWebWorkerEnv)&&i.setContentType(!1);var u=new XMLHttpRequest;if(e.auth){var c=e.auth.username||"",f=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(c+":"+f))}var l=be(e.baseURL,e.url);function d(){if(u){var r=pe.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());!function(e,t,n){var r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new q("Request failed with status code "+n.status,[q.ERR_BAD_REQUEST,q.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),s()}),(function(e){n(e),s()}),{data:a&&"text"!==a&&"json"!==a?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:r,config:e,request:u}),u=null}}if(u.open(e.method.toUpperCase(),Z(l,e.params,e.paramsSerializer),!0),u.timeout=e.timeout,"onloadend"in u?u.onloadend=d:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(d)},u.onabort=function(){u&&(n(new q("Request aborted",q.ECONNABORTED,e,u)),u=null)},u.onerror=function(){n(new q("Network Error",q.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){var t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",r=e.transitional||te;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new q(t,r.clarifyTimeoutError?q.ETIMEDOUT:q.ECONNABORTED,e,u)),u=null},ne.isStandardBrowserEnv){var p=(e.withCredentials||ge(l))&&e.xsrfCookieName&&ve.read(e.xsrfCookieName);p&&i.set(e.xsrfHeaderName,p)}void 0===o&&i.setContentType(null),"setRequestHeader"in u&&I.forEach(i.toJSON(),(function(e,t){u.setRequestHeader(t,e)})),I.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),a&&"json"!==a&&(u.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&u.addEventListener("progress",we(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",we(e.onUploadProgress)),(e.cancelToken||e.signal)&&(r=function(t){u&&(n(!t||t.type?new ye(null,e,u):t),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(r),e.signal&&(e.signal.aborted?r():e.signal.addEventListener("abort",r)));var h,m=(h=/^([-+\w]{1,25})(:?\/\/|:)/.exec(l))&&h[1]||"";m&&-1===ne.protocols.indexOf(m)?n(new q("Unsupported protocol "+m+":",q.ERR_BAD_REQUEST,e)):u.send(o||null)}))}};I.forEach(Ee,(function(e,t){if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var Oe=function(e){for(var t,n,r=(e=I.isArray(e)?e:[e]).length,o=0;o<r&&(t=e[o],!(n=I.isString(t)?Ee[t.toLowerCase()]:t));o++);if(!n){if(!1===n)throw new q("Adapter ".concat(t," is not supported by the environment"),"ERR_NOT_SUPPORT");throw new Error(I.hasOwnProp(Ee,t)?"Adapter '".concat(t,"' is not available in the build"):"Unknown adapter '".concat(t,"'"))}if(!I.isFunction(n))throw new TypeError("adapter is not a function");return n};function Se(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ye(null,e)}function Re(e){return Se(e),e.headers=pe.from(e.headers),e.data=he.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Oe(e.adapter||ae.adapter)(e).then((function(t){return Se(e),t.data=he.call(e,e.transformResponse,t),t.headers=pe.from(t.headers),t}),(function(t){return me(t)||(Se(e),t&&t.response&&(t.response.data=he.call(e,e.transformResponse,t.response),t.response.headers=pe.from(t.response.headers))),Promise.reject(t)}))}var Ae=function(e){return e instanceof pe?e.toJSON():e};function Te(e,t){t=t||{};var n={};function r(e,t,n){return I.isPlainObject(e)&&I.isPlainObject(t)?I.merge.call({caseless:n},e,t):I.isPlainObject(t)?I.merge({},t):I.isArray(t)?t.slice():t}function o(e,t,n){return I.isUndefined(t)?I.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function i(e,t){if(!I.isUndefined(t))return r(void 0,t)}function a(e,t){return I.isUndefined(t)?I.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,i){return i in t?r(n,o):i in e?r(void 0,n):void 0}var u={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:function(e,t){return o(Ae(e),Ae(t),!0)}};return I.forEach(Object.keys(e).concat(Object.keys(t)),(function(r){var i=u[r]||o,a=i(e[r],t[r],r);I.isUndefined(a)&&i!==s||(n[r]=a)})),n}var je="1.3.5",Ne={};["object","boolean","number","function","string","symbol"].forEach((function(t,n){Ne[t]=function(r){return e(r)===t||"a"+(n<1?"n ":" ")+t}}));var xe={};Ne.transitional=function(e,t,n){function r(e,t){return"[Axios v1.3.5] Transitional option '"+e+"'"+t+(n?". "+n:"")}return function(n,o,i){if(!1===e)throw new q(r(o," has been removed"+(t?" in "+t:"")),q.ERR_DEPRECATED);return t&&!xe[o]&&(xe[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}};var Ce={assertOptions:function(t,n,r){if("object"!==e(t))throw new q("options must be an object",q.ERR_BAD_OPTION_VALUE);for(var o=Object.keys(t),i=o.length;i-- >0;){var a=o[i],s=n[a];if(s){var u=t[a],c=void 0===u||s(u,a,t);if(!0!==c)throw new q("option "+a+" must be "+c,q.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new q("Unknown option "+a,q.ERR_BAD_OPTION)}},validators:Ne},Pe=Ce.validators,ke=function(){function e(n){t(this,e),this.defaults=n,this.interceptors={request:new ee,response:new ee}}return r(e,[{key:"request",value:function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{};var n,r=t=Te(this.defaults,t),o=r.transitional,i=r.paramsSerializer,a=r.headers;void 0!==o&&Ce.assertOptions(o,{silentJSONParsing:Pe.transitional(Pe.boolean),forcedJSONParsing:Pe.transitional(Pe.boolean),clarifyTimeoutError:Pe.transitional(Pe.boolean)},!1),null!=i&&(I.isFunction(i)?t.paramsSerializer={serialize:i}:Ce.assertOptions(i,{encode:Pe.function,serialize:Pe.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),(n=a&&I.merge(a.common,a[t.method]))&&I.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete a[e]})),t.headers=pe.concat(n,a);var s=[],u=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(u=u&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));var c,f=[];this.interceptors.response.forEach((function(e){f.push(e.fulfilled,e.rejected)}));var l,d=0;if(!u){var p=[Re.bind(this),void 0];for(p.unshift.apply(p,s),p.push.apply(p,f),l=p.length,c=Promise.resolve(t);d<l;)c=c.then(p[d++],p[d++]);return c}l=s.length;var h=t;for(d=0;d<l;){var m=s[d++],y=s[d++];try{h=m(h)}catch(e){y.call(this,e);break}}try{c=Re.call(this,h)}catch(e){return Promise.reject(e)}for(d=0,l=f.length;d<l;)c=c.then(f[d++],f[d++]);return c}},{key:"getUri",value:function(e){return Z(be((e=Te(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}]),e}();I.forEach(["delete","get","head","options"],(function(e){ke.prototype[e]=function(t,n){return this.request(Te(n||{},{method:e,url:t,data:(n||{}).data}))}})),I.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(Te(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}ke.prototype[e]=t(),ke.prototype[e+"Form"]=t(!0)}));var Ue=ke,_e=function(){function e(n){if(t(this,e),"function"!=typeof n)throw new TypeError("executor must be a function.");var r;this.promise=new Promise((function(e){r=e}));var o=this;this.promise.then((function(e){if(o._listeners){for(var t=o._listeners.length;t-- >0;)o._listeners[t](e);o._listeners=null}})),this.promise.then=function(e){var t,n=new Promise((function(e){o.subscribe(e),t=e})).then(e);return n.cancel=function(){o.unsubscribe(t)},n},n((function(e,t,n){o.reason||(o.reason=new ye(e,t,n),r(o.reason))}))}return r(e,[{key:"throwIfRequested",value:function(){if(this.reason)throw this.reason}},{key:"subscribe",value:function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}},{key:"unsubscribe",value:function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}}}],[{key:"source",value:function(){var t;return{token:new e((function(e){t=e})),cancel:t}}}]),e}();var Fe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Fe).forEach((function(e){var t=o(e,2),n=t[0],r=t[1];Fe[r]=n}));var Be=Fe;var Le=function e(t){var n=new Ue(t),r=a(Ue.prototype.request,n);return I.extend(r,Ue.prototype,n,{allOwnKeys:!0}),I.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Te(t,n))},r}(ae);return Le.Axios=Ue,Le.CanceledError=ye,Le.CancelToken=_e,Le.isCancel=me,Le.VERSION=je,Le.toFormData=V,Le.AxiosError=q,Le.Cancel=Le.CanceledError,Le.all=function(e){return Promise.all(e)},Le.spread=function(e){return function(t){return e.apply(null,t)}},Le.isAxiosError=function(e){return I.isObject(e)&&!0===e.isAxiosError},Le.mergeConfig=Te,Le.AxiosHeaders=pe,Le.formToJSON=function(e){return re(I.isHTMLForm(e)?new FormData(e):e)},Le.HttpStatusCode=Be,Le.default=Le,Le}));
|
| 2 |
-
// # sourceMappingURL=axios.min.js.map
|
|
|
|
|
|
|
|
|
sd_feed/javascript/best_feed.js
DELETED
|
@@ -1,638 +0,0 @@
|
|
| 1 |
-
|
| 2 |
-
function waitForElementToDisplay2(selector, callback, checkFrequencyInMs, timeoutInMs) {
|
| 3 |
-
(function loopSearch() {
|
| 4 |
-
if (document.querySelector(selector) != null && window.localStorage.getItem("userId")) {
|
| 5 |
-
callback();
|
| 6 |
-
return;
|
| 7 |
-
}
|
| 8 |
-
else if(document.getElementsByTagName("gradio-app").length > 0 &&
|
| 9 |
-
document.getElementsByTagName("gradio-app")[0].shadowRoot){
|
| 10 |
-
callback();
|
| 11 |
-
return;
|
| 12 |
-
}
|
| 13 |
-
else {
|
| 14 |
-
setTimeout(function () {
|
| 15 |
-
loopSearch();
|
| 16 |
-
}, checkFrequencyInMs);
|
| 17 |
-
}
|
| 18 |
-
})();
|
| 19 |
-
}
|
| 20 |
-
waitForElementToDisplay2(
|
| 21 |
-
"#html_id",
|
| 22 |
-
function(){
|
| 23 |
-
async function copyToClipboard(textToCopy) {
|
| 24 |
-
// Navigator clipboard api needs a secure context (https)
|
| 25 |
-
if (navigator.clipboard && window.isSecureContext) {
|
| 26 |
-
await navigator.clipboard.writeText(textToCopy);
|
| 27 |
-
} else {
|
| 28 |
-
// Use the 'out of viewport hidden text area' trick
|
| 29 |
-
const textArea = document.createElement("textarea");
|
| 30 |
-
textArea.value = textToCopy;
|
| 31 |
-
|
| 32 |
-
// Move textarea out of the viewport so it's not visible
|
| 33 |
-
textArea.style.position = "absolute";
|
| 34 |
-
textArea.style.left = "-999999px";
|
| 35 |
-
|
| 36 |
-
document.body.prepend(textArea);
|
| 37 |
-
textArea.select();
|
| 38 |
-
|
| 39 |
-
try {
|
| 40 |
-
document.execCommand('copy');
|
| 41 |
-
} catch (error) {
|
| 42 |
-
console.error(error);
|
| 43 |
-
} finally {
|
| 44 |
-
textArea.remove();
|
| 45 |
-
}
|
| 46 |
-
}
|
| 47 |
-
};
|
| 48 |
-
const userModel = {
|
| 49 |
-
data() {
|
| 50 |
-
return {
|
| 51 |
-
bestFeeds: [],
|
| 52 |
-
comments: [],
|
| 53 |
-
userId: '',
|
| 54 |
-
showCommentWrite: false,
|
| 55 |
-
comment: '',
|
| 56 |
-
src: '',
|
| 57 |
-
imageId: "",
|
| 58 |
-
metadata: {},
|
| 59 |
-
currentItem: {},
|
| 60 |
-
filterNsfw: false,
|
| 61 |
-
showModal:false,
|
| 62 |
-
|
| 63 |
-
}
|
| 64 |
-
},
|
| 65 |
-
watch: {
|
| 66 |
-
showModal() {
|
| 67 |
-
if (this.showModal === false) {
|
| 68 |
-
window.removeEventListener("keyup", this.onEscapeKey);
|
| 69 |
-
} else {
|
| 70 |
-
window.addEventListener("keyup", this.onEscapeKey);
|
| 71 |
-
}
|
| 72 |
-
}
|
| 73 |
-
},
|
| 74 |
-
methods: {
|
| 75 |
-
close() {
|
| 76 |
-
this.$emit('close');
|
| 77 |
-
this.showModal=false;
|
| 78 |
-
this.imageId = "";
|
| 79 |
-
this.src = "";
|
| 80 |
-
this.comment = '';
|
| 81 |
-
this.comments = [];
|
| 82 |
-
},
|
| 83 |
-
moveFeedProfileTab(event, nickname){
|
| 84 |
-
event.preventDefault();
|
| 85 |
-
if(nickname){
|
| 86 |
-
this.close();
|
| 87 |
-
const buttonList = gradioApp().querySelector('#tabs').querySelectorAll('button');
|
| 88 |
-
for (step = 0; step < buttonList.length; step++) {
|
| 89 |
-
// Runs 5 times, with values of step 0 through 4.
|
| 90 |
-
if(buttonList[step].textContent.trim() == 'Feed'){
|
| 91 |
-
buttonList[step].click();
|
| 92 |
-
break;
|
| 93 |
-
}
|
| 94 |
-
}
|
| 95 |
-
try{
|
| 96 |
-
const feedUserButton = gradioApp().querySelector('#feed-user-tab');
|
| 97 |
-
feedUserButton.setAttribute("data-value", nickname);
|
| 98 |
-
feedUserButton.innerHTML = nickname;
|
| 99 |
-
feedUserButton.click();
|
| 100 |
-
|
| 101 |
-
}catch(e){
|
| 102 |
-
console.log(e);
|
| 103 |
-
}
|
| 104 |
-
|
| 105 |
-
}
|
| 106 |
-
|
| 107 |
-
},
|
| 108 |
-
closeOutsideModal(event) {
|
| 109 |
-
if(!event.target.closest('.prompt-modal-image-tag')){
|
| 110 |
-
this.$emit('close');
|
| 111 |
-
this.showModal=false;
|
| 112 |
-
this.imageId = "";
|
| 113 |
-
this.src = "";
|
| 114 |
-
this.comment = '';
|
| 115 |
-
this.comments = [];
|
| 116 |
-
}
|
| 117 |
-
},
|
| 118 |
-
onEscapeKey(event) {
|
| 119 |
-
if (event.keyCode === 27 || event.key === 'Escape') {
|
| 120 |
-
// Perform action when "Esc" key is pressed
|
| 121 |
-
this.close();
|
| 122 |
-
}
|
| 123 |
-
// Perform action when "Esc" key is pressed
|
| 124 |
-
},
|
| 125 |
-
fetchBests(){
|
| 126 |
-
const token = localStorage.getItem("token");
|
| 127 |
-
const userId = localStorage.getItem("userId");
|
| 128 |
-
const headers={"Authorization":"Token " + token};
|
| 129 |
-
const params = {
|
| 130 |
-
filter_nsfw: this.filterNsfw,
|
| 131 |
-
};
|
| 132 |
-
axios.get(
|
| 133 |
-
`https://newtypev3-server-vjiloyvjvq-an.a.run.app/image/best/${userId}`,
|
| 134 |
-
{
|
| 135 |
-
headers,
|
| 136 |
-
params
|
| 137 |
-
}
|
| 138 |
-
)
|
| 139 |
-
.then(response => {
|
| 140 |
-
const dataObject = response.data;
|
| 141 |
-
this.bestFeeds = dataObject.slice(0, 4);
|
| 142 |
-
}).catch(error => {
|
| 143 |
-
this.loading = false;
|
| 144 |
-
console.log(error)
|
| 145 |
-
});
|
| 146 |
-
},
|
| 147 |
-
formatNumber(num) {
|
| 148 |
-
if (num >= 1000000) {
|
| 149 |
-
return (num / 1000000).toFixed(1) + 'm';
|
| 150 |
-
} else if (num >= 1000) {
|
| 151 |
-
return (num / 1000).toFixed(1) + 'k';
|
| 152 |
-
} else {
|
| 153 |
-
return num.toString();
|
| 154 |
-
}
|
| 155 |
-
},
|
| 156 |
-
openModal(item){
|
| 157 |
-
this.showModal = true;
|
| 158 |
-
this.$forceUpdate();
|
| 159 |
-
this.currentItem = item;
|
| 160 |
-
this.metadata = item.metadata;
|
| 161 |
-
this.src = item.url;
|
| 162 |
-
this.imageId = item.id;
|
| 163 |
-
item.total_clicks += 1;
|
| 164 |
-
this.addImageClick();
|
| 165 |
-
this.fetchComments();
|
| 166 |
-
},
|
| 167 |
-
openModalSecond(event){
|
| 168 |
-
console.log(event);
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
},
|
| 172 |
-
addImageClick(){
|
| 173 |
-
const userId = localStorage.getItem("userId");
|
| 174 |
-
const imageId = this.imageId;
|
| 175 |
-
const token = localStorage.getItem("token");
|
| 176 |
-
const headers={"Authorization":"Token " + token};
|
| 177 |
-
axios.post(
|
| 178 |
-
'https://newtypev3-server-vjiloyvjvq-an.a.run.app/image/click',
|
| 179 |
-
{
|
| 180 |
-
userId,
|
| 181 |
-
imageId,
|
| 182 |
-
},
|
| 183 |
-
{
|
| 184 |
-
headers
|
| 185 |
-
}
|
| 186 |
-
)
|
| 187 |
-
.then(response => {
|
| 188 |
-
this.showModal = true;
|
| 189 |
-
}).catch(error => {
|
| 190 |
-
this.loading = false;
|
| 191 |
-
console.log(error)
|
| 192 |
-
})
|
| 193 |
-
},
|
| 194 |
-
sendToTextToImage(){
|
| 195 |
-
const userId = localStorage.getItem("userId");
|
| 196 |
-
const token = localStorage.getItem("token");
|
| 197 |
-
const headers={"Authorization":"Token " + token};
|
| 198 |
-
|
| 199 |
-
const imageId = this.imageId;
|
| 200 |
-
this.currentItem.total_sendto = this.currentItem.total_sendto + 1;
|
| 201 |
-
axios.post(
|
| 202 |
-
'https://newtypev3-server-vjiloyvjvq-an.a.run.app/image/send_to',
|
| 203 |
-
{
|
| 204 |
-
userId,
|
| 205 |
-
imageId,
|
| 206 |
-
sendType: "SEND_TO_TEXT",
|
| 207 |
-
},
|
| 208 |
-
{
|
| 209 |
-
headers
|
| 210 |
-
}
|
| 211 |
-
)
|
| 212 |
-
.then(response => {
|
| 213 |
-
this.sendToTextProcess();
|
| 214 |
-
}).catch(error => {
|
| 215 |
-
this.loading = false;
|
| 216 |
-
console.log(error)
|
| 217 |
-
})
|
| 218 |
-
},
|
| 219 |
-
|
| 220 |
-
copyClipboard(){
|
| 221 |
-
const userId = localStorage.getItem("userId");
|
| 222 |
-
const imageId = this.imageId;
|
| 223 |
-
const token = localStorage.getItem("token");
|
| 224 |
-
const headers={"Authorization":"Token " + token};
|
| 225 |
-
axios.post(
|
| 226 |
-
'https://newtypev3-server-vjiloyvjvq-an.a.run.app/image/send_to',
|
| 227 |
-
{
|
| 228 |
-
userId,
|
| 229 |
-
imageId,
|
| 230 |
-
sendType: "COPY_TO_CLIPBOARD",
|
| 231 |
-
},
|
| 232 |
-
{
|
| 233 |
-
headers
|
| 234 |
-
}
|
| 235 |
-
)
|
| 236 |
-
.then(response => {
|
| 237 |
-
let filteredObject = '';
|
| 238 |
-
for (const [k, v] of Object.entries(this.metadata)) {
|
| 239 |
-
if (/^[A-Z]/.test(k)) {
|
| 240 |
-
filteredObject += `${k}:${v},`;
|
| 241 |
-
}
|
| 242 |
-
}
|
| 243 |
-
this.currentItem.total_sendto = this.currentItem.total_sendto + 1;
|
| 244 |
-
copyToClipboard(filteredObject);
|
| 245 |
-
}).catch(error => {
|
| 246 |
-
this.loading = false;
|
| 247 |
-
console.log(error)
|
| 248 |
-
});
|
| 249 |
-
|
| 250 |
-
},
|
| 251 |
-
sendToTextProcess(){
|
| 252 |
-
const textPrompt = gradioApp().querySelector('#txt2img_prompt').getElementsByTagName( 'textarea' );
|
| 253 |
-
if(textPrompt&&textPrompt.length> 0){
|
| 254 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_prompt')[0].props.value = this.metadata.prompt;
|
| 255 |
-
textPrompt[0].value = this.metadata.prompt;
|
| 256 |
-
}
|
| 257 |
-
const negativePrompt = gradioApp().querySelector('#txt2img_neg_prompt').getElementsByTagName( 'textarea' );
|
| 258 |
-
if(negativePrompt&&negativePrompt.length> 0){
|
| 259 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_neg_prompt')[0].props.value = this.metadata.negative_prompt;
|
| 260 |
-
negativePrompt[0].value = this.metadata.negative_prompt;
|
| 261 |
-
}
|
| 262 |
-
try{
|
| 263 |
-
const samplerList = gradioApp().querySelector( '#txt2img_sampling' ).getElementsByTagName('span');
|
| 264 |
-
if(samplerList&&samplerList.length> 1){
|
| 265 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_sampling')[0].props.value = this.metadata.sampler;
|
| 266 |
-
samplerList[1].textContent = this.metadata.sampler;
|
| 267 |
-
}
|
| 268 |
-
}catch(e){
|
| 269 |
-
}
|
| 270 |
-
|
| 271 |
-
try{
|
| 272 |
-
const textImageStepsList = gradioApp().querySelector( '#txt2img_steps' ).getElementsByTagName('input');
|
| 273 |
-
if(textImageStepsList&&textImageStepsList.length> 1){
|
| 274 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_steps')[0].props.value = parseInt(this.metadata.n_iter);
|
| 275 |
-
textImageStepsList[0].value = this.metadata.n_iter;
|
| 276 |
-
textImageStepsList[1].value = this.metadata.n_iter;
|
| 277 |
-
}
|
| 278 |
-
}catch(e){
|
| 279 |
-
}
|
| 280 |
-
try{
|
| 281 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_width')[0].props.value = parseInt(this.metadata['Size-1']);
|
| 282 |
-
const textWidthList = gradioApp().querySelector( '#txt2img_width' ).getElementsByTagName('input');
|
| 283 |
-
if(textWidthList&&textWidthList.length> 1){
|
| 284 |
-
textWidthList[0].value = this.metadata['Size-1'];
|
| 285 |
-
textWidthList[1].value = this.metadata['Size-1'];
|
| 286 |
-
}
|
| 287 |
-
}catch(e){
|
| 288 |
-
}
|
| 289 |
-
try{
|
| 290 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_height')[0].props.value = parseInt(this.metadata['Size-2']);
|
| 291 |
-
const textWidthList = gradioApp().querySelector( '#txt2img_height' ).getElementsByTagName('input');
|
| 292 |
-
if(textWidthList&&textWidthList.length> 1){
|
| 293 |
-
textWidthList[0].value = this.metadata['Size-2'];
|
| 294 |
-
textWidthList[1].value = this.metadata['Size-2'];
|
| 295 |
-
}
|
| 296 |
-
}catch(e){
|
| 297 |
-
}
|
| 298 |
-
try{
|
| 299 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_cfg_scale')[0].props.value = parseFloat(this.metadata['cfg_scale']);
|
| 300 |
-
const cfgScaleList = gradioApp().querySelector( '#txt2img_cfg_scale' ).getElementsByTagName('input');
|
| 301 |
-
if(cfgScaleList&&cfgScaleList.length> 1){
|
| 302 |
-
cfgScaleList[0].value = this.metadata['cfg_scale'];
|
| 303 |
-
cfgScaleList[1].value = this.metadata['cfg_scale'];
|
| 304 |
-
}
|
| 305 |
-
}catch(e){
|
| 306 |
-
}
|
| 307 |
-
try{
|
| 308 |
-
const steps = this.metadata['Hires upscaler'];
|
| 309 |
-
if(steps){
|
| 310 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_enable_hr')[0].props.value = true;
|
| 311 |
-
gradioApp().querySelector( '#txt2img_enable_hr' ).getElementsByTagName('input')[0].checked = true;
|
| 312 |
-
try{
|
| 313 |
-
const originalHires = gradioApp().querySelector( '#txt2img_hires_fix' );
|
| 314 |
-
originalHires.classList.remove('hidden');
|
| 315 |
-
}catch(e){
|
| 316 |
-
|
| 317 |
-
}
|
| 318 |
-
const scalerMethod = this.metadata['Hires upscaler'];
|
| 319 |
-
const containUpscaler = window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_hr_upscaler')[0].props.choices.includes(scalerMethod);
|
| 320 |
-
if(containUpscaler){
|
| 321 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_hr_upscaler')[0].props.value = this.metadata['Hires upscaler'];
|
| 322 |
-
const hr_span = gradioApp().querySelector( '#txt2img_hr_upscaler' ).getElementsByTagName('span');
|
| 323 |
-
hr_span[0].textContent = this.metadata['Hires upscaler'];
|
| 324 |
-
|
| 325 |
-
const cfgScaleList = gradioApp().querySelector( '#txt2img_enable_hr' ).getElementsByTagName('input');
|
| 326 |
-
if(cfgScaleList&&cfgScaleList.length> 1){
|
| 327 |
-
cfgScaleList[0].value = this.metadata['cfg_scale'];
|
| 328 |
-
cfgScaleList[1].value = this.metadata['cfg_scale'];
|
| 329 |
-
}
|
| 330 |
-
}
|
| 331 |
-
try{
|
| 332 |
-
try{
|
| 333 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_hires_steps')[0].props.value = parseInt(this.metadata['Hires steps']);
|
| 334 |
-
}catch(e){
|
| 335 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_hires_steps')[0].props.value = 0;
|
| 336 |
-
}
|
| 337 |
-
|
| 338 |
-
const cfgScaleList = gradioApp().querySelector( '#txt2img_hires_steps' ).getElementsByTagName('input');
|
| 339 |
-
if(cfgScaleList&&cfgScaleList.length> 1){
|
| 340 |
-
cfgScaleList[0].value = this.metadata['Hires steps'];
|
| 341 |
-
cfgScaleList[1].value = this.metadata['Hires steps'];
|
| 342 |
-
}
|
| 343 |
-
}catch(e){
|
| 344 |
-
console.log(e);
|
| 345 |
-
console.log('errorhr0');
|
| 346 |
-
}
|
| 347 |
-
|
| 348 |
-
try{
|
| 349 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_hr_scale')[0].props.value = this.metadata['Hires upscale'];
|
| 350 |
-
const cfgScaleList = gradioApp().querySelector( '#txt2img_hr_scale' ).getElementsByTagName('input');
|
| 351 |
-
if(cfgScaleList&&cfgScaleList.length> 1){
|
| 352 |
-
cfgScaleList[0].value = this.metadata['Hires upscale'];
|
| 353 |
-
cfgScaleList[1].value = this.metadata['Hires upscale'];
|
| 354 |
-
}
|
| 355 |
-
}catch(e){
|
| 356 |
-
console.log(e);
|
| 357 |
-
console.log('errorhr');
|
| 358 |
-
}
|
| 359 |
-
try{
|
| 360 |
-
let hiresValue = parseInt(this.metadata['Hires resize-1']);
|
| 361 |
-
if(hiresValue == 0){
|
| 362 |
-
hiresValue = parseInt(this.metadata['Size-1']);
|
| 363 |
-
}
|
| 364 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_hr_resize_x')[0].props.value = hiresValue;
|
| 365 |
-
const cfgScaleList = gradioApp().querySelector( '#txt2img_hr_resize_x' ).getElementsByTagName('input');
|
| 366 |
-
if(cfgScaleList&&cfgScaleList.length> 1){
|
| 367 |
-
cfgScaleList[0].value = this.metadata['Hires resize-1'];
|
| 368 |
-
cfgScaleList[1].value = this.metadata['Hires resize-1'];
|
| 369 |
-
}
|
| 370 |
-
}catch(e){
|
| 371 |
-
console.log(e);
|
| 372 |
-
console.log('errorhr2');
|
| 373 |
-
}
|
| 374 |
-
try{
|
| 375 |
-
let hiresValueSecond = parseInt(this.metadata['Hires resize-2']);
|
| 376 |
-
if(hiresValueSecond == 0){
|
| 377 |
-
hiresValueSecond = parseInt(this.metadata['Size-2']);
|
| 378 |
-
}
|
| 379 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_hr_resize_y')[0].props.value = hiresValueSecond;
|
| 380 |
-
const cfgScaleList = gradioApp().querySelector( '#txt2img_hr_resize_y' ).getElementsByTagName('input');
|
| 381 |
-
if(cfgScaleList&&cfgScaleList.length> 1){
|
| 382 |
-
cfgScaleList[0].value = this.metadata['Hires resize-2'];
|
| 383 |
-
cfgScaleList[1].value = this.metadata['Hires resize-2'];
|
| 384 |
-
}
|
| 385 |
-
}catch(e){
|
| 386 |
-
console.log(e);
|
| 387 |
-
console.log('errorhr3');
|
| 388 |
-
}
|
| 389 |
-
}
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
}catch(e){
|
| 393 |
-
console.log(e);
|
| 394 |
-
console.log('errorhr4');
|
| 395 |
-
}
|
| 396 |
-
this.close();
|
| 397 |
-
},
|
| 398 |
-
sendToImageToImage(){
|
| 399 |
-
const userId = localStorage.getItem("userId");
|
| 400 |
-
const imageId = this.imageId;
|
| 401 |
-
const token = localStorage.getItem("token");
|
| 402 |
-
const headers={"Authorization":"Token " + token};
|
| 403 |
-
axios.post(
|
| 404 |
-
'https://newtypev3-server-vjiloyvjvq-an.a.run.app/image/send_to',
|
| 405 |
-
{
|
| 406 |
-
userId,
|
| 407 |
-
imageId,
|
| 408 |
-
sendType: "SEND_TO_IMAGE",
|
| 409 |
-
},
|
| 410 |
-
{
|
| 411 |
-
headers
|
| 412 |
-
}
|
| 413 |
-
)
|
| 414 |
-
.then(response => {
|
| 415 |
-
var xhr = new XMLHttpRequest();
|
| 416 |
-
var self = this;
|
| 417 |
-
xhr.onload = function() {
|
| 418 |
-
var reader = new FileReader();
|
| 419 |
-
reader.onloadend = function() {
|
| 420 |
-
self.sendToImageToImageProcess(reader.result);
|
| 421 |
-
}
|
| 422 |
-
reader.readAsDataURL(xhr.response);
|
| 423 |
-
};
|
| 424 |
-
xhr.open('GET', this.src);
|
| 425 |
-
xhr.responseType = 'blob';
|
| 426 |
-
xhr.send();
|
| 427 |
-
this.currentItem.total_sendto = this.currentItem.total_sendto + 1;
|
| 428 |
-
|
| 429 |
-
}).catch(error => {
|
| 430 |
-
this.loading = false;
|
| 431 |
-
console.log(error)
|
| 432 |
-
})
|
| 433 |
-
},
|
| 434 |
-
sendToImageToImageProcess(date64Image){
|
| 435 |
-
try{
|
| 436 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='img2img_image')[0].props.value = date64Image;
|
| 437 |
-
}catch(e){
|
| 438 |
-
|
| 439 |
-
}
|
| 440 |
-
try{
|
| 441 |
-
const textPrompt = gradioApp().querySelector('#img2img_prompt').getElementsByTagName( 'textarea' );
|
| 442 |
-
if(textPrompt&&textPrompt.length> 0){
|
| 443 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='img2img_prompt')[0].props.value = this.metadata.prompt;
|
| 444 |
-
textPrompt[0].value = this.metadata.prompt;
|
| 445 |
-
}
|
| 446 |
-
}catch(e){
|
| 447 |
-
console.log('Error prompt img2img');
|
| 448 |
-
console.log(e);
|
| 449 |
-
|
| 450 |
-
}
|
| 451 |
-
try{
|
| 452 |
-
const negativePrompt = gradioApp().querySelector('#img2img_neg_prompt').getElementsByTagName( 'textarea' );
|
| 453 |
-
if(negativePrompt&&negativePrompt.length> 0){
|
| 454 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='img2img_neg_prompt')[0].props.value = this.metadata.negative_prompt;
|
| 455 |
-
negativePrompt[0].value = this.metadata.negative_prompt;
|
| 456 |
-
}
|
| 457 |
-
}catch(e){
|
| 458 |
-
console.log('Error neg img2img');
|
| 459 |
-
console.log(e);
|
| 460 |
-
|
| 461 |
-
}
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
try{
|
| 465 |
-
const samplerList = gradioApp().querySelector( '#img2img_sampling' ).getElementsByTagName('span');
|
| 466 |
-
if(samplerList&&samplerList.length> 1){
|
| 467 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='img2img_sampling')[0].props.value = this.metadata.sampler;
|
| 468 |
-
samplerList[1].textContent = this.metadata.sampler;
|
| 469 |
-
}
|
| 470 |
-
}catch(e){
|
| 471 |
-
}
|
| 472 |
-
|
| 473 |
-
try{
|
| 474 |
-
const textImageStepsList = gradioApp().querySelector( '#img2img_steps' ).getElementsByTagName('input');
|
| 475 |
-
if(textImageStepsList&&textImageStepsList.length> 1){
|
| 476 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='img2img_steps')[0].props.value = parseInt(this.metadata.n_iter);
|
| 477 |
-
textImageStepsList[0].value = this.metadata.n_iter;
|
| 478 |
-
textImageStepsList[1].value = this.metadata.n_iter;
|
| 479 |
-
}
|
| 480 |
-
}catch(e){
|
| 481 |
-
console.log('Error steps img2img');
|
| 482 |
-
console.log(e);
|
| 483 |
-
|
| 484 |
-
}
|
| 485 |
-
try{
|
| 486 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='img2img_width')[0].props.value = parseInt(this.metadata['Size-1']);
|
| 487 |
-
const textWidthList = gradioApp().querySelector( '#img2img_width' ).getElementsByTagName('input');
|
| 488 |
-
if(textWidthList&&textWidthList.length> 1){
|
| 489 |
-
textWidthList[0].value = this.metadata['Size-1'];
|
| 490 |
-
textWidthList[1].value = this.metadata['Size-1'];
|
| 491 |
-
}
|
| 492 |
-
}catch(e){
|
| 493 |
-
console.log('Error width img2img');
|
| 494 |
-
console.log(e);
|
| 495 |
-
}
|
| 496 |
-
try{
|
| 497 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='img2img_height')[0].props.value = parseInt(this.metadata['Size-2']);
|
| 498 |
-
const textWidthList = gradioApp().querySelector( '#img2img_height' ).getElementsByTagName('input');
|
| 499 |
-
if(textWidthList&&textWidthList.length> 1){
|
| 500 |
-
textWidthList[0].value = this.metadata['Size-2'];
|
| 501 |
-
textWidthList[1].value = this.metadata['Size-2'];
|
| 502 |
-
}
|
| 503 |
-
}catch(e){
|
| 504 |
-
console.log('Error width height2img');
|
| 505 |
-
console.log(e);
|
| 506 |
-
}
|
| 507 |
-
this.close();
|
| 508 |
-
switch_to_img2img();
|
| 509 |
-
},
|
| 510 |
-
addToWishList(item){
|
| 511 |
-
const userId = localStorage.getItem("userId");
|
| 512 |
-
const token = localStorage.getItem("token");
|
| 513 |
-
const headers={"Authorization":"Token " + token};
|
| 514 |
-
item.liked = true;
|
| 515 |
-
item.likecount = item.likecount + 1;
|
| 516 |
-
axios.post(
|
| 517 |
-
`https://newtypev3-server-vjiloyvjvq-an.a.run.app/image/like`,
|
| 518 |
-
{
|
| 519 |
-
userId,
|
| 520 |
-
imageId: item.id,
|
| 521 |
-
},
|
| 522 |
-
{
|
| 523 |
-
headers
|
| 524 |
-
}
|
| 525 |
-
)
|
| 526 |
-
},
|
| 527 |
-
handleTextareaInput(event) {
|
| 528 |
-
let textarea = event.target;
|
| 529 |
-
textarea.style.height = 'auto';
|
| 530 |
-
textarea.style.height = (textarea.scrollHeight) + 'px';
|
| 531 |
-
comment = event.target.text;
|
| 532 |
-
},
|
| 533 |
-
deleteWishList(item){
|
| 534 |
-
console.log('delete');
|
| 535 |
-
const userId = localStorage.getItem("userId");
|
| 536 |
-
item.liked = false;
|
| 537 |
-
item.likecount = item.likecount -1 ;
|
| 538 |
-
const token = localStorage.getItem("token");
|
| 539 |
-
const headers={"Authorization":"Token " + token};
|
| 540 |
-
axios.delete(
|
| 541 |
-
`https://newtypev3-server-vjiloyvjvq-an.a.run.app/image/like`,
|
| 542 |
-
{
|
| 543 |
-
data: {
|
| 544 |
-
userId,
|
| 545 |
-
imageId: item.id,
|
| 546 |
-
},
|
| 547 |
-
headers
|
| 548 |
-
},
|
| 549 |
-
)
|
| 550 |
-
},
|
| 551 |
-
makeSaveButtonVisible(){
|
| 552 |
-
this.showCommentWrite = true;
|
| 553 |
-
},
|
| 554 |
-
hideSaveButtonVisible(){
|
| 555 |
-
this.comment = '';
|
| 556 |
-
this.showCommentWrite = false;
|
| 557 |
-
const textArea = gradioApp().querySelector("#modal-writer-type");
|
| 558 |
-
textArea.style.height = 'auto';
|
| 559 |
-
textArea.style.height = (textarea.scrollHeight) + 'px';
|
| 560 |
-
},
|
| 561 |
-
writeComment(){
|
| 562 |
-
if(this.comment.length > 0){
|
| 563 |
-
const userId = localStorage.getItem("userId");
|
| 564 |
-
const token = localStorage.getItem("token");
|
| 565 |
-
const headers={"Authorization":"Token " + token};
|
| 566 |
-
axios.post(
|
| 567 |
-
`https://newtypev3-server-vjiloyvjvq-an.a.run.app/image/comment`,
|
| 568 |
-
{
|
| 569 |
-
userId,
|
| 570 |
-
imageId: this.currentItem.id,
|
| 571 |
-
text: this.comment,
|
| 572 |
-
},
|
| 573 |
-
{
|
| 574 |
-
headers
|
| 575 |
-
}
|
| 576 |
-
).then((res)=>{
|
| 577 |
-
this.fetchComments();
|
| 578 |
-
this.showCommentWrite = false;
|
| 579 |
-
this.comment = '';
|
| 580 |
-
this.currentItem.total_comments = this.currentItem.total_comments + 1;
|
| 581 |
-
}).catch((e)=>{
|
| 582 |
-
console.log(e);
|
| 583 |
-
});
|
| 584 |
-
|
| 585 |
-
}else{
|
| 586 |
-
return false;
|
| 587 |
-
}
|
| 588 |
-
},
|
| 589 |
-
fetchComments(){
|
| 590 |
-
var self = this;
|
| 591 |
-
const token = localStorage.getItem("token");
|
| 592 |
-
const headers={"Authorization":"Token " + token};
|
| 593 |
-
axios.get(
|
| 594 |
-
`https://newtypev3-server-vjiloyvjvq-an.a.run.app/image/comments/${this.currentItem.id}`,
|
| 595 |
-
{
|
| 596 |
-
headers
|
| 597 |
-
}
|
| 598 |
-
).then((res)=>{
|
| 599 |
-
self.comments = res.data;
|
| 600 |
-
}).catch((e)=>{
|
| 601 |
-
console.log(e);
|
| 602 |
-
})
|
| 603 |
-
},
|
| 604 |
-
},
|
| 605 |
-
computed:{
|
| 606 |
-
isModalOpen(){
|
| 607 |
-
return this.showModal;
|
| 608 |
-
},
|
| 609 |
-
},
|
| 610 |
-
created() {
|
| 611 |
-
const userId = localStorage.getItem("userId");
|
| 612 |
-
const token = localStorage.getItem("token");
|
| 613 |
-
const headers={"Authorization":"Token " + token};
|
| 614 |
-
axios.get(
|
| 615 |
-
`https://newtypev3-server-vjiloyvjvq-an.a.run.app/image/best/${userId}`,
|
| 616 |
-
{
|
| 617 |
-
headers
|
| 618 |
-
}
|
| 619 |
-
)
|
| 620 |
-
.then(response => {
|
| 621 |
-
const dataObject = response.data;
|
| 622 |
-
this.userId = userId;
|
| 623 |
-
this.bestFeeds = dataObject.slice(0, 4);
|
| 624 |
-
}).catch(error => {
|
| 625 |
-
this.loading = false;
|
| 626 |
-
console.log(error)
|
| 627 |
-
})
|
| 628 |
-
},
|
| 629 |
-
};
|
| 630 |
-
const fetchApp = Vue.createApp(userModel);
|
| 631 |
-
if (document.querySelector("#best-product-tab") != null) {
|
| 632 |
-
fetchApp.mount('#best-product-tab');
|
| 633 |
-
}else{
|
| 634 |
-
fetchApp.mount(document.getElementsByTagName("gradio-app")[0].shadowRoot.getElementById("best-product-tab"));
|
| 635 |
-
}
|
| 636 |
-
console.log('mount success');
|
| 637 |
-
},1000,9000);
|
| 638 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sd_feed/javascript/goosviewmodel.js
DELETED
|
@@ -1,860 +0,0 @@
|
|
| 1 |
-
var installLoaded = {};
|
| 2 |
-
function addScript(url) {
|
| 3 |
-
if (!installLoaded[url]) {
|
| 4 |
-
var s = document.createElement('script');
|
| 5 |
-
s.src = url;
|
| 6 |
-
document.head.appendChild(s);
|
| 7 |
-
installLoaded[url] = true;
|
| 8 |
-
}
|
| 9 |
-
}
|
| 10 |
-
function waitForElementToDisplay(selector, callback, checkFrequencyInMs, timeoutInMs) {
|
| 11 |
-
(function loopSearch() {
|
| 12 |
-
if (document.querySelector(selector) != null&& window.localStorage.getItem("userId")) {
|
| 13 |
-
callback();
|
| 14 |
-
return;
|
| 15 |
-
}
|
| 16 |
-
else if(document.getElementsByTagName("gradio-app").length > 0 &&
|
| 17 |
-
document.getElementsByTagName("gradio-app")[0].shadowRoot){
|
| 18 |
-
callback();
|
| 19 |
-
return;
|
| 20 |
-
}
|
| 21 |
-
else {
|
| 22 |
-
setTimeout(function () {
|
| 23 |
-
loopSearch();
|
| 24 |
-
}, checkFrequencyInMs);
|
| 25 |
-
}
|
| 26 |
-
})();
|
| 27 |
-
}
|
| 28 |
-
const reorderData=(arr, columns)=>{
|
| 29 |
-
const cols = columns;
|
| 30 |
-
const out = [];
|
| 31 |
-
let col = 0;
|
| 32 |
-
while(col < cols) {
|
| 33 |
-
for(let i = 0; i < arr.length; i += cols) {
|
| 34 |
-
let _val = arr[i + col];
|
| 35 |
-
if (_val !== undefined)
|
| 36 |
-
out.push(_val);
|
| 37 |
-
}
|
| 38 |
-
col++;
|
| 39 |
-
}
|
| 40 |
-
return out;
|
| 41 |
-
}
|
| 42 |
-
|
| 43 |
-
// addScript('https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js');
|
| 44 |
-
// addScript('https://unpkg.com/vue@3.2.6/dist/vue.global.prod.js');
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
waitForElementToDisplay(
|
| 48 |
-
"#html_id",
|
| 49 |
-
function(){
|
| 50 |
-
async function copyToClipboard(textToCopy) {
|
| 51 |
-
// Navigator clipboard api needs a secure context (https)
|
| 52 |
-
if (navigator.clipboard && window.isSecureContext) {
|
| 53 |
-
await navigator.clipboard.writeText(textToCopy);
|
| 54 |
-
} else {
|
| 55 |
-
// Use the 'out of viewport hidden text area' trick
|
| 56 |
-
const textArea = document.createElement("textarea");
|
| 57 |
-
textArea.value = textToCopy;
|
| 58 |
-
|
| 59 |
-
// Move textarea out of the viewport so it's not visible
|
| 60 |
-
textArea.style.position = "absolute";
|
| 61 |
-
textArea.style.left = "-999999px";
|
| 62 |
-
|
| 63 |
-
document.body.prepend(textArea);
|
| 64 |
-
textArea.select();
|
| 65 |
-
|
| 66 |
-
try {
|
| 67 |
-
document.execCommand('copy');
|
| 68 |
-
} catch (error) {
|
| 69 |
-
console.error(error);
|
| 70 |
-
} finally {
|
| 71 |
-
textArea.remove();
|
| 72 |
-
}
|
| 73 |
-
}
|
| 74 |
-
};
|
| 75 |
-
const imageModel = {
|
| 76 |
-
data() {
|
| 77 |
-
return {
|
| 78 |
-
page: 1,
|
| 79 |
-
loading: false,
|
| 80 |
-
uploadLoading: false,
|
| 81 |
-
imageList: [],
|
| 82 |
-
sortedDataList: [],
|
| 83 |
-
carouselBtnTop: 150,
|
| 84 |
-
showCommentWrite: false,
|
| 85 |
-
modeSelectList: [
|
| 86 |
-
{ name: "Newest", value: "latest" },
|
| 87 |
-
{ name: "Popular", value: "likes" },
|
| 88 |
-
{ name: "Favorite", value: "favorite" },
|
| 89 |
-
{ name: "My Feed", value: "private" },
|
| 90 |
-
],
|
| 91 |
-
mode: "latest",
|
| 92 |
-
prompt: "",
|
| 93 |
-
showModal: false,
|
| 94 |
-
metadata: {},
|
| 95 |
-
filterNsfw: false,
|
| 96 |
-
animeTag: false,
|
| 97 |
-
realTag: false,
|
| 98 |
-
nickname: '',
|
| 99 |
-
profile: '',
|
| 100 |
-
editMode: false,
|
| 101 |
-
userId: '',
|
| 102 |
-
searchNickname: "",
|
| 103 |
-
searchProfile: "",
|
| 104 |
-
}
|
| 105 |
-
},
|
| 106 |
-
computed: {
|
| 107 |
-
parsedProfile(){
|
| 108 |
-
if(!this.profile){
|
| 109 |
-
return this.profile;
|
| 110 |
-
}
|
| 111 |
-
return this.profile.replaceAll("\n", "<br/>");
|
| 112 |
-
},
|
| 113 |
-
parsedSearchProfile(){
|
| 114 |
-
if(!this.searchProfile){
|
| 115 |
-
return '';
|
| 116 |
-
}
|
| 117 |
-
return this.searchProfile.replaceAll("\n", "<br/>");
|
| 118 |
-
}
|
| 119 |
-
},
|
| 120 |
-
watch: {
|
| 121 |
-
showModal() {
|
| 122 |
-
if (this.showModal === false) {
|
| 123 |
-
window.removeEventListener("keyup", this.onEscapeKey);
|
| 124 |
-
} else {
|
| 125 |
-
window.addEventListener("keyup", this.onEscapeKey);
|
| 126 |
-
}
|
| 127 |
-
}
|
| 128 |
-
},
|
| 129 |
-
methods: {
|
| 130 |
-
setEditMode(){
|
| 131 |
-
this.editMode = !this.editMode;
|
| 132 |
-
},
|
| 133 |
-
setNicknameSearch(){
|
| 134 |
-
this.mode = 'nicknameSearch';
|
| 135 |
-
const feedUserButton = gradioApp().querySelector('#feed-user-tab');
|
| 136 |
-
const nickname = feedUserButton.getAttribute("data-value");
|
| 137 |
-
this.searchNickname = nickname;
|
| 138 |
-
this.fetchSearchProfile();
|
| 139 |
-
this.fetchNewImage();
|
| 140 |
-
},
|
| 141 |
-
moveFeedProfileTab(nickname){
|
| 142 |
-
if(nickname){
|
| 143 |
-
this.close();
|
| 144 |
-
const buttonList = gradioApp().querySelector('#tabs').querySelectorAll('button');
|
| 145 |
-
for (step = 0; step < buttonList.length; step++) {
|
| 146 |
-
// Runs 5 times, with values of step 0 through 4.
|
| 147 |
-
if(buttonList[step].textContent.trim() == 'Feed'){
|
| 148 |
-
buttonList[step].click();
|
| 149 |
-
break;
|
| 150 |
-
}
|
| 151 |
-
}
|
| 152 |
-
try{
|
| 153 |
-
const feedUserButton = gradioApp().querySelector('#feed-user-tab');
|
| 154 |
-
feedUserButton.setAttribute("data-value", nickname);
|
| 155 |
-
feedUserButton.innerHTML = nickname;
|
| 156 |
-
feedUserButton.click();
|
| 157 |
-
|
| 158 |
-
}catch(e){
|
| 159 |
-
console.log(e);
|
| 160 |
-
}
|
| 161 |
-
|
| 162 |
-
}
|
| 163 |
-
|
| 164 |
-
},
|
| 165 |
-
saveNickname(){
|
| 166 |
-
const userId = localStorage.getItem("userId");
|
| 167 |
-
const token = localStorage.getItem("token");
|
| 168 |
-
const headers={"Authorization":"Token " + token};
|
| 169 |
-
axios.post(
|
| 170 |
-
`https://newtypev3-server-vjiloyvjvq-an.a.run.app/user/profile`,
|
| 171 |
-
{
|
| 172 |
-
userId,
|
| 173 |
-
nickname: this.nickname,
|
| 174 |
-
profile: this.profile,
|
| 175 |
-
},
|
| 176 |
-
{
|
| 177 |
-
headers
|
| 178 |
-
}
|
| 179 |
-
)
|
| 180 |
-
.then(response => {
|
| 181 |
-
this.editMode = false;
|
| 182 |
-
})
|
| 183 |
-
.catch(error => {
|
| 184 |
-
this.loading = false;
|
| 185 |
-
alert(error.response.data.detail);
|
| 186 |
-
})
|
| 187 |
-
},
|
| 188 |
-
selectAnimeTag(){
|
| 189 |
-
if(this.animeTag == false){
|
| 190 |
-
this.animeTag = true;
|
| 191 |
-
this.realTag = false;
|
| 192 |
-
}else{
|
| 193 |
-
this.animeTag = false;
|
| 194 |
-
this.realTag = false;
|
| 195 |
-
}
|
| 196 |
-
this.fetchNewImage();
|
| 197 |
-
},
|
| 198 |
-
selectRealTag(){
|
| 199 |
-
if(this.realTag == false){
|
| 200 |
-
this.realTag = true;
|
| 201 |
-
this.animeTag = false;
|
| 202 |
-
}else{
|
| 203 |
-
this.realTag = false;
|
| 204 |
-
this.animeTag = false;
|
| 205 |
-
}
|
| 206 |
-
this.fetchNewImage();
|
| 207 |
-
},
|
| 208 |
-
async uploadImage(event){
|
| 209 |
-
this.uploadLoading = true;
|
| 210 |
-
const files = event.target.files;
|
| 211 |
-
const userId = localStorage.getItem("userId");
|
| 212 |
-
for (let i=0; i<files.length; i++) {
|
| 213 |
-
if(!files[i].type.match(/^image\//)){
|
| 214 |
-
alert('이미지 파일만 업로드할 수 있습니다.');
|
| 215 |
-
} else if(files[i].size > 50000000) {
|
| 216 |
-
alert('You cannot upload file larger than 50MB');
|
| 217 |
-
} else {
|
| 218 |
-
var body = new FormData();
|
| 219 |
-
body.append('upload_file',files[i]);
|
| 220 |
-
body.append('userId', userId);
|
| 221 |
-
body.append('extractMetadata', true);
|
| 222 |
-
const token = localStorage.getItem("token");
|
| 223 |
-
const headers={"Authorization":"Token " + token};
|
| 224 |
-
try{
|
| 225 |
-
await axios({
|
| 226 |
-
url: 'https://newtypev3-server-vjiloyvjvq-an.a.run.app/image/image',
|
| 227 |
-
method: 'post',
|
| 228 |
-
withCredentials:true,
|
| 229 |
-
data: body,
|
| 230 |
-
headers
|
| 231 |
-
});
|
| 232 |
-
}catch(e){
|
| 233 |
-
console.log(e);
|
| 234 |
-
}
|
| 235 |
-
}
|
| 236 |
-
}
|
| 237 |
-
this.setMode('private');
|
| 238 |
-
this.uploadLoading = false;
|
| 239 |
-
},
|
| 240 |
-
close() {
|
| 241 |
-
this.$emit('close');
|
| 242 |
-
this.showModal=false;
|
| 243 |
-
this.imageId = "";
|
| 244 |
-
this.src = "";
|
| 245 |
-
this.comment = '';
|
| 246 |
-
this.comments = [];
|
| 247 |
-
},
|
| 248 |
-
closeOutsideModal(event) {
|
| 249 |
-
if(!event.target.closest('.prompt-modal-image-tag')){
|
| 250 |
-
this.$emit('close');
|
| 251 |
-
this.showModal=false;
|
| 252 |
-
this.imageId = "";
|
| 253 |
-
this.src = "";
|
| 254 |
-
this.comment = '';
|
| 255 |
-
this.comments = [];
|
| 256 |
-
}
|
| 257 |
-
},
|
| 258 |
-
onEscapeKey(event) {
|
| 259 |
-
if (event.keyCode === 27 || event.key === 'Escape') {
|
| 260 |
-
// Perform action when "Esc" key is pressed
|
| 261 |
-
this.close();
|
| 262 |
-
}
|
| 263 |
-
// Perform action when "Esc" key is pressed
|
| 264 |
-
},
|
| 265 |
-
formatNumber(num) {
|
| 266 |
-
if (num >= 1000000) {
|
| 267 |
-
return (num / 1000000).toFixed(1) + 'm';
|
| 268 |
-
} else if (num >= 1000) {
|
| 269 |
-
return (num / 1000).toFixed(1) + 'k';
|
| 270 |
-
} else {
|
| 271 |
-
return num.toString();
|
| 272 |
-
}
|
| 273 |
-
},
|
| 274 |
-
openModal(item){
|
| 275 |
-
this.showModal = true;
|
| 276 |
-
this.currentItem = item;
|
| 277 |
-
this.metadata = item.metadata;
|
| 278 |
-
this.src = item.url;
|
| 279 |
-
this.imageId = item.id;
|
| 280 |
-
item.total_clicks += 1;
|
| 281 |
-
this.addImageClick();
|
| 282 |
-
this.fetchComments();
|
| 283 |
-
},
|
| 284 |
-
addImageClick(){
|
| 285 |
-
const userId = localStorage.getItem("userId");
|
| 286 |
-
const imageId = this.imageId;
|
| 287 |
-
const token = localStorage.getItem("token");
|
| 288 |
-
const headers={"Authorization":"Token " + token};
|
| 289 |
-
axios.post(
|
| 290 |
-
'https://newtypev3-server-vjiloyvjvq-an.a.run.app/image/click',
|
| 291 |
-
{
|
| 292 |
-
userId,
|
| 293 |
-
imageId,
|
| 294 |
-
},
|
| 295 |
-
{
|
| 296 |
-
headers
|
| 297 |
-
}
|
| 298 |
-
)
|
| 299 |
-
.then(response => {
|
| 300 |
-
|
| 301 |
-
}).catch(error => {
|
| 302 |
-
this.loading = false;
|
| 303 |
-
console.log(error)
|
| 304 |
-
})
|
| 305 |
-
},
|
| 306 |
-
sendToTextToImage(){
|
| 307 |
-
const userId = localStorage.getItem("userId");
|
| 308 |
-
const imageId = this.imageId;
|
| 309 |
-
const token = localStorage.getItem("token");
|
| 310 |
-
const headers={"Authorization":"Token " + token};
|
| 311 |
-
this.currentItem.total_sendto = this.currentItem.total_sendto + 1;
|
| 312 |
-
axios.post(
|
| 313 |
-
'https://newtypev3-server-vjiloyvjvq-an.a.run.app/image/send_to',
|
| 314 |
-
{
|
| 315 |
-
userId,
|
| 316 |
-
imageId,
|
| 317 |
-
sendType: "SEND_TO_TEXT",
|
| 318 |
-
},{
|
| 319 |
-
headers
|
| 320 |
-
}
|
| 321 |
-
)
|
| 322 |
-
.then(response => {
|
| 323 |
-
this.sendToTextProcess();
|
| 324 |
-
}).catch(error => {
|
| 325 |
-
this.loading = false;
|
| 326 |
-
console.log(error)
|
| 327 |
-
})
|
| 328 |
-
},
|
| 329 |
-
copyClipboard(){
|
| 330 |
-
const userId = localStorage.getItem("userId");
|
| 331 |
-
const imageId = this.imageId;
|
| 332 |
-
const token = localStorage.getItem("token");
|
| 333 |
-
const headers={"Authorization":"Token " + token};
|
| 334 |
-
axios.post(
|
| 335 |
-
'https://newtypev3-server-vjiloyvjvq-an.a.run.app/image/send_to',
|
| 336 |
-
{
|
| 337 |
-
userId,
|
| 338 |
-
imageId,
|
| 339 |
-
sendType: "COPY_TO_CLIPBOARD",
|
| 340 |
-
},{
|
| 341 |
-
headers
|
| 342 |
-
}
|
| 343 |
-
)
|
| 344 |
-
.then(response => {
|
| 345 |
-
let filteredObject = '';
|
| 346 |
-
for (const [k, v] of Object.entries(this.metadata)) {
|
| 347 |
-
if (/^[A-Z]/.test(k)) {
|
| 348 |
-
filteredObject += `${k}:${v},`;
|
| 349 |
-
}
|
| 350 |
-
}
|
| 351 |
-
this.currentItem.total_sendto = this.currentItem.total_sendto + 1;
|
| 352 |
-
copyToClipboard(filteredObject);
|
| 353 |
-
}).catch(error => {
|
| 354 |
-
this.loading = false;
|
| 355 |
-
console.log(error)
|
| 356 |
-
});
|
| 357 |
-
|
| 358 |
-
},
|
| 359 |
-
sendToTextProcess(){
|
| 360 |
-
const textPrompt = gradioApp().querySelector('#txt2img_prompt').getElementsByTagName( 'textarea' );
|
| 361 |
-
if(textPrompt&&textPrompt.length> 0){
|
| 362 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_prompt')[0].props.value = this.metadata.prompt;
|
| 363 |
-
textPrompt[0].value = this.metadata.prompt;
|
| 364 |
-
}
|
| 365 |
-
const negativePrompt = gradioApp().querySelector('#txt2img_neg_prompt').getElementsByTagName( 'textarea' );
|
| 366 |
-
if(negativePrompt&&negativePrompt.length> 0){
|
| 367 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_neg_prompt')[0].props.value = this.metadata.negative_prompt;
|
| 368 |
-
negativePrompt[0].value = this.metadata.negative_prompt;
|
| 369 |
-
}
|
| 370 |
-
try{
|
| 371 |
-
const samplerList = gradioApp().querySelector( '#txt2img_sampling' ).getElementsByTagName('span');
|
| 372 |
-
if(samplerList&&samplerList.length> 1){
|
| 373 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_sampling')[0].props.value = this.metadata.sampler;
|
| 374 |
-
samplerList[1].textContent = this.metadata.sampler;
|
| 375 |
-
}
|
| 376 |
-
}catch(e){
|
| 377 |
-
}
|
| 378 |
-
|
| 379 |
-
try{
|
| 380 |
-
const textImageStepsList = gradioApp().querySelector( '#txt2img_steps' ).getElementsByTagName('input');
|
| 381 |
-
if(textImageStepsList&&textImageStepsList.length> 1){
|
| 382 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_steps')[0].props.value = parseInt(this.metadata.n_iter);
|
| 383 |
-
textImageStepsList[0].value = this.metadata.n_iter;
|
| 384 |
-
textImageStepsList[1].value = this.metadata.n_iter;
|
| 385 |
-
}
|
| 386 |
-
}catch(e){
|
| 387 |
-
}
|
| 388 |
-
try{
|
| 389 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_width')[0].props.value = parseFloat(this.metadata['Size-1']);
|
| 390 |
-
const textWidthList = gradioApp().querySelector( '#txt2img_width' ).getElementsByTagName('input');
|
| 391 |
-
if(textWidthList&&textWidthList.length> 1){
|
| 392 |
-
textWidthList[0].value = this.metadata['Size-1'];
|
| 393 |
-
textWidthList[1].value = this.metadata['Size-1'];
|
| 394 |
-
}
|
| 395 |
-
}catch(e){
|
| 396 |
-
}
|
| 397 |
-
try{
|
| 398 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_height')[0].props.value = parseFloat(this.metadata['Size-2']);
|
| 399 |
-
const textWidthList = gradioApp().querySelector( '#txt2img_height' ).getElementsByTagName('input');
|
| 400 |
-
if(textWidthList&&textWidthList.length> 1){
|
| 401 |
-
textWidthList[0].value = this.metadata['Size-2'];
|
| 402 |
-
textWidthList[1].value = this.metadata['Size-2'];
|
| 403 |
-
}
|
| 404 |
-
}catch(e){
|
| 405 |
-
}
|
| 406 |
-
try{
|
| 407 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_cfg_scale')[0].props.value = parseFloat(this.metadata['cfg_scale']);
|
| 408 |
-
const cfgScaleList = gradioApp().querySelector( '#txt2img_cfg_scale' ).getElementsByTagName('input');
|
| 409 |
-
if(cfgScaleList&&cfgScaleList.length> 1){
|
| 410 |
-
cfgScaleList[0].value = this.metadata['cfg_scale'];
|
| 411 |
-
cfgScaleList[1].value = this.metadata['cfg_scale'];
|
| 412 |
-
}
|
| 413 |
-
}catch(e){
|
| 414 |
-
}
|
| 415 |
-
try{
|
| 416 |
-
const steps = this.metadata['Hires upscaler'];
|
| 417 |
-
if(steps){
|
| 418 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_enable_hr')[0].props.value = true;
|
| 419 |
-
gradioApp().querySelector( '#txt2img_enable_hr' ).getElementsByTagName('input')[0].checked = true;
|
| 420 |
-
try{
|
| 421 |
-
const originalHires = gradioApp().querySelector( '#txt2img_hires_fix' );
|
| 422 |
-
originalHires.classList.remove('hidden');
|
| 423 |
-
}catch(e){
|
| 424 |
-
|
| 425 |
-
}
|
| 426 |
-
const scalerMethod = this.metadata['Hires upscaler'];
|
| 427 |
-
const containUpscaler = window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_hr_upscaler')[0].props.choices.includes(scalerMethod);
|
| 428 |
-
if(containUpscaler){
|
| 429 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_hr_upscaler')[0].props.value = this.metadata['Hires upscaler'];
|
| 430 |
-
const hr_span = gradioApp().querySelector( '#txt2img_hr_upscaler' ).getElementsByTagName('span');
|
| 431 |
-
hr_span[0].textContent = this.metadata['Hires upscaler'];
|
| 432 |
-
|
| 433 |
-
const cfgScaleList = gradioApp().querySelector( '#txt2img_enable_hr' ).getElementsByTagName('input');
|
| 434 |
-
if(cfgScaleList&&cfgScaleList.length> 1){
|
| 435 |
-
cfgScaleList[0].value = this.metadata['cfg_scale'];
|
| 436 |
-
cfgScaleList[1].value = this.metadata['cfg_scale'];
|
| 437 |
-
}
|
| 438 |
-
}
|
| 439 |
-
try{
|
| 440 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_hires_steps')[0].props.value = parseInt(this.metadata['Hires steps']);
|
| 441 |
-
const cfgScaleList = gradioApp().querySelector( '#txt2img_hires_steps' ).getElementsByTagName('input');
|
| 442 |
-
if(cfgScaleList&&cfgScaleList.length> 1){
|
| 443 |
-
cfgScaleList[0].value = this.metadata['Hires steps'];
|
| 444 |
-
cfgScaleList[1].value = this.metadata['Hires steps'];
|
| 445 |
-
}
|
| 446 |
-
}catch(e){
|
| 447 |
-
console.log(e);
|
| 448 |
-
console.log('errorhr0');
|
| 449 |
-
}
|
| 450 |
-
try{
|
| 451 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_hr_scale')[0].props.value = parseFloat(this.metadata['Hires upscale']);
|
| 452 |
-
const cfgScaleList = gradioApp().querySelector( '#txt2img_hr_scale' ).getElementsByTagName('input');
|
| 453 |
-
if(cfgScaleList&&cfgScaleList.length> 1){
|
| 454 |
-
cfgScaleList[0].value = this.metadata['Hires upscale'];
|
| 455 |
-
cfgScaleList[1].value = this.metadata['Hires upscale'];
|
| 456 |
-
}
|
| 457 |
-
}catch(e){
|
| 458 |
-
console.log(e);
|
| 459 |
-
console.log('errorhr');
|
| 460 |
-
}
|
| 461 |
-
try{
|
| 462 |
-
const hiresValue1 = parseInt(this.metadata['Hires resize-1']);
|
| 463 |
-
console.log(hiresValue1);
|
| 464 |
-
if(hiresValue1 && hiresValue1 > 0){
|
| 465 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_hr_resize_x')[0].props.value = parseInt(this.metadata['Hires resize-1']);
|
| 466 |
-
const cfgScaleList = gradioApp().querySelector( '#txt2img_hr_resize_x' ).getElementsByTagName('input');
|
| 467 |
-
if(cfgScaleList&&cfgScaleList.length> 1){
|
| 468 |
-
cfgScaleList[0].value = this.metadata['Hires resize-1'];
|
| 469 |
-
cfgScaleList[1].value = this.metadata['Hires resize-1'];
|
| 470 |
-
}
|
| 471 |
-
}
|
| 472 |
-
}catch(e){
|
| 473 |
-
console.log(e);
|
| 474 |
-
console.log('errorhr2');
|
| 475 |
-
}
|
| 476 |
-
try{
|
| 477 |
-
const hiresValue2 = parseInt(this.metadata['Hires resize-2']);
|
| 478 |
-
console.log(hiresValue2);
|
| 479 |
-
if(hiresValue2 > 0){
|
| 480 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='txt2img_hr_resize_y')[0].props.value = parseInt(this.metadata['Hires resize-2']);
|
| 481 |
-
const cfgScaleList = gradioApp().querySelector( '#txt2img_hr_resize_y' ).getElementsByTagName('input');
|
| 482 |
-
if(cfgScaleList&&cfgScaleList.length> 1){
|
| 483 |
-
cfgScaleList[0].value = this.metadata['Hires resize-2'];
|
| 484 |
-
cfgScaleList[1].value = this.metadata['Hires resize-2'];
|
| 485 |
-
}
|
| 486 |
-
}
|
| 487 |
-
}catch(e){
|
| 488 |
-
console.log(e);
|
| 489 |
-
console.log('errorhr3');
|
| 490 |
-
}
|
| 491 |
-
}
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
}catch(e){
|
| 496 |
-
console.log(e);
|
| 497 |
-
console.log('errorhr4');
|
| 498 |
-
}
|
| 499 |
-
this.close();
|
| 500 |
-
switch_to_txt2img();
|
| 501 |
-
},
|
| 502 |
-
sendToImageToImage(){
|
| 503 |
-
const userId = localStorage.getItem("userId");
|
| 504 |
-
const imageId = this.imageId;
|
| 505 |
-
const token = localStorage.getItem("token");
|
| 506 |
-
const headers={"Authorization":"Token " + token};
|
| 507 |
-
axios.post(
|
| 508 |
-
'https://newtypev3-server-vjiloyvjvq-an.a.run.app/image/send_to',
|
| 509 |
-
{
|
| 510 |
-
userId,
|
| 511 |
-
imageId,
|
| 512 |
-
sendType: "SEND_TO_IMAGE",
|
| 513 |
-
},{
|
| 514 |
-
headers
|
| 515 |
-
}
|
| 516 |
-
)
|
| 517 |
-
.then(response => {
|
| 518 |
-
var xhr = new XMLHttpRequest();
|
| 519 |
-
var self = this;
|
| 520 |
-
xhr.onload = function() {
|
| 521 |
-
var reader = new FileReader();
|
| 522 |
-
reader.onloadend = function() {
|
| 523 |
-
self.sendToImageToImageProcess(reader.result);
|
| 524 |
-
}
|
| 525 |
-
reader.readAsDataURL(xhr.response);
|
| 526 |
-
};
|
| 527 |
-
xhr.open('GET', this.src);
|
| 528 |
-
xhr.responseType = 'blob';
|
| 529 |
-
xhr.send();
|
| 530 |
-
this.currentItem.total_sendto = this.currentItem.total_sendto + 1;
|
| 531 |
-
|
| 532 |
-
}).catch(error => {
|
| 533 |
-
this.loading = false;
|
| 534 |
-
console.log(error)
|
| 535 |
-
})
|
| 536 |
-
},
|
| 537 |
-
sendToImageToImageProcess(date64Image){
|
| 538 |
-
try{
|
| 539 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='img2img_image')[0].props.value = date64Image;
|
| 540 |
-
}catch(e){
|
| 541 |
-
|
| 542 |
-
}
|
| 543 |
-
try{
|
| 544 |
-
const textPrompt = gradioApp().querySelector('#img2img_prompt').getElementsByTagName( 'textarea' );
|
| 545 |
-
if(textPrompt&&textPrompt.length> 0){
|
| 546 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='img2img_prompt')[0].props.value = this.metadata.prompt;
|
| 547 |
-
textPrompt[0].value = this.metadata.prompt;
|
| 548 |
-
}
|
| 549 |
-
}catch(e){
|
| 550 |
-
console.log('Error prompt img2img');
|
| 551 |
-
console.log(e);
|
| 552 |
-
|
| 553 |
-
}
|
| 554 |
-
try{
|
| 555 |
-
const negativePrompt = gradioApp().querySelector('#img2img_neg_prompt').getElementsByTagName( 'textarea' );
|
| 556 |
-
if(negativePrompt&&negativePrompt.length> 0){
|
| 557 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='img2img_neg_prompt')[0].props.value = this.metadata.negative_prompt;
|
| 558 |
-
negativePrompt[0].value = this.metadata.negative_prompt;
|
| 559 |
-
}
|
| 560 |
-
}catch(e){
|
| 561 |
-
console.log('Error neg img2img');
|
| 562 |
-
console.log(e);
|
| 563 |
-
|
| 564 |
-
}
|
| 565 |
-
|
| 566 |
-
|
| 567 |
-
try{
|
| 568 |
-
const samplerList = gradioApp().querySelector( '#img2img_sampling' ).getElementsByTagName('span');
|
| 569 |
-
if(samplerList&&samplerList.length> 1){
|
| 570 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='img2img_sampling')[0].props.value = this.metadata.sampler;
|
| 571 |
-
samplerList[1].textContent = this.metadata.sampler;
|
| 572 |
-
}
|
| 573 |
-
}catch(e){
|
| 574 |
-
}
|
| 575 |
-
|
| 576 |
-
try{
|
| 577 |
-
const textImageStepsList = gradioApp().querySelector( '#img2img_steps' ).getElementsByTagName('input');
|
| 578 |
-
if(textImageStepsList&&textImageStepsList.length> 1){
|
| 579 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='img2img_steps')[0].props.value = parseInt(this.metadata.n_iter);
|
| 580 |
-
textImageStepsList[0].value = this.metadata.n_iter;
|
| 581 |
-
textImageStepsList[1].value = this.metadata.n_iter;
|
| 582 |
-
}
|
| 583 |
-
}catch(e){
|
| 584 |
-
console.log('Error steps img2img');
|
| 585 |
-
console.log(e);
|
| 586 |
-
|
| 587 |
-
}
|
| 588 |
-
try{
|
| 589 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='img2img_width')[0].props.value = parseInt(this.metadata['Size-1']);
|
| 590 |
-
const textWidthList = gradioApp().querySelector( '#img2img_width' ).getElementsByTagName('input');
|
| 591 |
-
if(textWidthList&&textWidthList.length> 1){
|
| 592 |
-
textWidthList[0].value = this.metadata['Size-1'];
|
| 593 |
-
textWidthList[1].value = this.metadata['Size-1'];
|
| 594 |
-
}
|
| 595 |
-
}catch(e){
|
| 596 |
-
console.log('Error width img2img');
|
| 597 |
-
console.log(e);
|
| 598 |
-
}
|
| 599 |
-
try{
|
| 600 |
-
window.gradio_config.components.filter(el=>el.props.elem_id=='img2img_height')[0].props.value = parseInt(this.metadata['Size-2']);
|
| 601 |
-
const textWidthList = gradioApp().querySelector( '#img2img_height' ).getElementsByTagName('input');
|
| 602 |
-
if(textWidthList&&textWidthList.length> 1){
|
| 603 |
-
textWidthList[0].value = this.metadata['Size-2'];
|
| 604 |
-
textWidthList[1].value = this.metadata['Size-2'];
|
| 605 |
-
}
|
| 606 |
-
}catch(e){
|
| 607 |
-
console.log('Error width height2img');
|
| 608 |
-
console.log(e);
|
| 609 |
-
}
|
| 610 |
-
this.close();
|
| 611 |
-
switch_to_img2img();
|
| 612 |
-
},
|
| 613 |
-
addToWishList(item){
|
| 614 |
-
const userId = localStorage.getItem("userId");
|
| 615 |
-
const token = localStorage.getItem("token");
|
| 616 |
-
const headers={"Authorization":"Token " + token};
|
| 617 |
-
item.liked = true;
|
| 618 |
-
item.likecount = item.likecount + 1;
|
| 619 |
-
axios.post(
|
| 620 |
-
`https://newtypev3-server-vjiloyvjvq-an.a.run.app/image/like`,
|
| 621 |
-
{
|
| 622 |
-
userId,
|
| 623 |
-
imageId: item.id,
|
| 624 |
-
},
|
| 625 |
-
{
|
| 626 |
-
headers
|
| 627 |
-
}
|
| 628 |
-
)
|
| 629 |
-
},
|
| 630 |
-
handleTextareaInput(event) {
|
| 631 |
-
let textarea = event.target;
|
| 632 |
-
textarea.style.height = 'auto';
|
| 633 |
-
textarea.style.height = (textarea.scrollHeight) + 'px';
|
| 634 |
-
comment = event.target.text;
|
| 635 |
-
},
|
| 636 |
-
deleteWishList(item){
|
| 637 |
-
const userId = localStorage.getItem("userId");
|
| 638 |
-
item.liked = false;
|
| 639 |
-
item.likecount = item.likecount -1 ;
|
| 640 |
-
const token = localStorage.getItem("token");
|
| 641 |
-
const headers={"Authorization":"Token " + token};
|
| 642 |
-
axios.delete(
|
| 643 |
-
`https://newtypev3-server-vjiloyvjvq-an.a.run.app/image/like`,
|
| 644 |
-
{data: {
|
| 645 |
-
userId,
|
| 646 |
-
imageId: item.id,
|
| 647 |
-
},
|
| 648 |
-
headers
|
| 649 |
-
},
|
| 650 |
-
)
|
| 651 |
-
},
|
| 652 |
-
makeSaveButtonVisible(){
|
| 653 |
-
this.showCommentWrite = true;
|
| 654 |
-
},
|
| 655 |
-
hideSaveButtonVisible(){
|
| 656 |
-
this.comment = '';
|
| 657 |
-
this.showCommentWrite = false;
|
| 658 |
-
const textArea = gradioApp().querySelector("#modal-writer-type");
|
| 659 |
-
textArea.style.height = 'auto';
|
| 660 |
-
textArea.style.height = (textarea.scrollHeight) + 'px';
|
| 661 |
-
},
|
| 662 |
-
writeComment(){
|
| 663 |
-
if(this.comment.length > 0){
|
| 664 |
-
const userId = localStorage.getItem("userId");
|
| 665 |
-
const token = localStorage.getItem("token");
|
| 666 |
-
const headers={"Authorization":"Token " + token};
|
| 667 |
-
axios.post(
|
| 668 |
-
`https://newtypev3-server-vjiloyvjvq-an.a.run.app/image/comment`,
|
| 669 |
-
{
|
| 670 |
-
userId,
|
| 671 |
-
imageId: this.currentItem.id,
|
| 672 |
-
text: this.comment,
|
| 673 |
-
},{
|
| 674 |
-
headers
|
| 675 |
-
}
|
| 676 |
-
).then((res)=>{
|
| 677 |
-
this.fetchComments();
|
| 678 |
-
this.showCommentWrite = false;
|
| 679 |
-
this.comment = '';
|
| 680 |
-
this.currentItem.total_comments = this.currentItem.total_comments + 1;
|
| 681 |
-
}).catch((e)=>{
|
| 682 |
-
console.log(e);
|
| 683 |
-
});
|
| 684 |
-
|
| 685 |
-
}else{
|
| 686 |
-
return false;
|
| 687 |
-
}
|
| 688 |
-
},
|
| 689 |
-
fetchComments(){
|
| 690 |
-
const token = localStorage.getItem("token");
|
| 691 |
-
const headers={"Authorization":"Token " + token};
|
| 692 |
-
axios.get(
|
| 693 |
-
`https://newtypev3-server-vjiloyvjvq-an.a.run.app/image/comments/${this.currentItem.id}`,
|
| 694 |
-
{
|
| 695 |
-
headers
|
| 696 |
-
}
|
| 697 |
-
).then((res)=>{
|
| 698 |
-
this.comments = res.data;
|
| 699 |
-
this.$forceUpdate();
|
| 700 |
-
}).catch((e)=>{
|
| 701 |
-
console.log(e);
|
| 702 |
-
})
|
| 703 |
-
},
|
| 704 |
-
setOrder(event){
|
| 705 |
-
this.page = 1;
|
| 706 |
-
this.order = event.target.value;
|
| 707 |
-
this.fetchImages();
|
| 708 |
-
},
|
| 709 |
-
setPublic(event){
|
| 710 |
-
this.page = 1;
|
| 711 |
-
this.mode = event.target.value;
|
| 712 |
-
this.fetchImages();
|
| 713 |
-
},
|
| 714 |
-
setMode(mode){
|
| 715 |
-
this.page = 1;
|
| 716 |
-
this.mode = mode;
|
| 717 |
-
this.fetchImages();
|
| 718 |
-
},
|
| 719 |
-
fetchSearchProfile(){
|
| 720 |
-
const params = {
|
| 721 |
-
nickname: this.searchNickname,
|
| 722 |
-
};
|
| 723 |
-
axios.get(
|
| 724 |
-
`https://newtypev3-server-vjiloyvjvq-an.a.run.app/user/profile_nickname`,
|
| 725 |
-
{
|
| 726 |
-
params
|
| 727 |
-
}
|
| 728 |
-
).then((res)=>{
|
| 729 |
-
this.searchProfile = res.data.profile;
|
| 730 |
-
this.$forceUpdate();
|
| 731 |
-
}).catch((e)=>{
|
| 732 |
-
console.log(e);
|
| 733 |
-
})
|
| 734 |
-
},
|
| 735 |
-
fetchNewImage(){
|
| 736 |
-
this.page = 1;
|
| 737 |
-
this.fetchImages();
|
| 738 |
-
},
|
| 739 |
-
fetchImages(){
|
| 740 |
-
this.loading = true;
|
| 741 |
-
if(this.page == -1){
|
| 742 |
-
this.loading = false;
|
| 743 |
-
return false;
|
| 744 |
-
}
|
| 745 |
-
const userId = localStorage.getItem("userId");
|
| 746 |
-
const defaultParams = {
|
| 747 |
-
page: this.page,
|
| 748 |
-
batch_size: 100,
|
| 749 |
-
prompt: this.prompt,
|
| 750 |
-
filter_nsfw: this.filterNsfw,
|
| 751 |
-
};
|
| 752 |
-
if(this.mode == 'latest'){
|
| 753 |
-
defaultParams['order'] = 'created_at';
|
| 754 |
-
}
|
| 755 |
-
if(this.mode == 'nicknameSearch'){
|
| 756 |
-
defaultParams['nickname'] = this.searchNickname;
|
| 757 |
-
defaultParams['order'] = 'created_at';
|
| 758 |
-
}
|
| 759 |
-
if(this.animeTag){
|
| 760 |
-
defaultParams['image_tag'] = 'ANIME';
|
| 761 |
-
}
|
| 762 |
-
if(this.realTag){
|
| 763 |
-
defaultParams['image_tag'] = 'REAL';
|
| 764 |
-
}
|
| 765 |
-
if(this.mode == 'likes'){
|
| 766 |
-
defaultParams['order'] = 'likes';
|
| 767 |
-
}
|
| 768 |
-
if(this.mode == 'favorite'){
|
| 769 |
-
defaultParams['only_liked_pictures'] = true;
|
| 770 |
-
defaultParams['order'] = 'likes_created';
|
| 771 |
-
}
|
| 772 |
-
if(this.mode == 'private'){
|
| 773 |
-
defaultParams['only_my_pictures'] = true;
|
| 774 |
-
defaultParams['order'] = 'created_at';
|
| 775 |
-
}
|
| 776 |
-
const token = localStorage.getItem("token");
|
| 777 |
-
const headers={"Authorization":"Token " + token};
|
| 778 |
-
|
| 779 |
-
axios.get(
|
| 780 |
-
`https://newtypev3-server-vjiloyvjvq-an.a.run.app/image/images/${userId}`,
|
| 781 |
-
{params: defaultParams, headers},
|
| 782 |
-
)
|
| 783 |
-
.then(response => {
|
| 784 |
-
if(this.page == 1){
|
| 785 |
-
this.imageList = response.data;
|
| 786 |
-
}else{
|
| 787 |
-
this.imageList = [...this.imageList, ...response.data];
|
| 788 |
-
}
|
| 789 |
-
this.sortedDataList = reorderData(this.imageList, 4);
|
| 790 |
-
if(response.data.length < 100){
|
| 791 |
-
this.page = -1;
|
| 792 |
-
}
|
| 793 |
-
this.loading = false;
|
| 794 |
-
})
|
| 795 |
-
.catch(error => {
|
| 796 |
-
this.loading = false;
|
| 797 |
-
console.log(error)
|
| 798 |
-
})
|
| 799 |
-
|
| 800 |
-
}
|
| 801 |
-
},
|
| 802 |
-
mounted(){
|
| 803 |
-
var self = this;
|
| 804 |
-
waitForElementToDisplay('#feed-header', function(){
|
| 805 |
-
window.addEventListener('scroll', e => {
|
| 806 |
-
const listElem = gradioApp().querySelector("#columns");
|
| 807 |
-
const tabElem = gradioApp().querySelector("#tab_newtype_tab");
|
| 808 |
-
const tabNotVisible = tabElem && tabElem.style && tabElem.style.display && tabElem.style.display == 'none';
|
| 809 |
-
if(listElem&&listElem.clientHeight * 0.8 <= window.scrollY && self.loading == false && self.page > 0 && !tabNotVisible) {
|
| 810 |
-
self.page = self.page + 1;
|
| 811 |
-
self.fetchImages();
|
| 812 |
-
}
|
| 813 |
-
}, false);
|
| 814 |
-
},1000,9000);
|
| 815 |
-
|
| 816 |
-
},
|
| 817 |
-
beforeDestroy(){
|
| 818 |
-
|
| 819 |
-
},
|
| 820 |
-
created() {
|
| 821 |
-
this.fetchImages();
|
| 822 |
-
const userId = localStorage.getItem("userId");
|
| 823 |
-
const token = localStorage.getItem("token");
|
| 824 |
-
const headers={"Authorization":"Token " + token};
|
| 825 |
-
axios.get(
|
| 826 |
-
`https://newtypev3-server-vjiloyvjvq-an.a.run.app/user/profile/${userId}`,
|
| 827 |
-
{
|
| 828 |
-
headers
|
| 829 |
-
}
|
| 830 |
-
)
|
| 831 |
-
.then(response => {
|
| 832 |
-
const dataObject = response.data;;
|
| 833 |
-
this.likeCount = dataObject.likecount;
|
| 834 |
-
this.nickname = dataObject.nickname;
|
| 835 |
-
this.profile = dataObject.profile;
|
| 836 |
-
this.userId = userId;
|
| 837 |
-
}).catch(error => {
|
| 838 |
-
this.loading = false;
|
| 839 |
-
console.log(error)
|
| 840 |
-
})
|
| 841 |
-
},
|
| 842 |
-
};
|
| 843 |
-
const fetchApp = Vue.createApp(imageModel);
|
| 844 |
-
if (document.querySelector("#vue-elem") != null) {
|
| 845 |
-
fetchApp.mount('#vue-elem');
|
| 846 |
-
}else{
|
| 847 |
-
fetchApp.mount(document.getElementsByTagName("gradio-app")[0].shadowRoot.getElementById("vue-elem"));
|
| 848 |
-
}
|
| 849 |
-
// const fileInput = gradioApp().querySelector('#feed-image-upload');
|
| 850 |
-
// fileInput.addEventListener("change", function() {
|
| 851 |
-
// fileInput.dispatchEvent(new CustomEvent("on_file_upload"));
|
| 852 |
-
// setTimeout(() =>{
|
| 853 |
-
// const el = gradioApp().querySelector(
|
| 854 |
-
// '#feed-search-btn'
|
| 855 |
-
// );
|
| 856 |
-
// el.click();
|
| 857 |
-
// }, 2000);
|
| 858 |
-
// });
|
| 859 |
-
console.log("mount success");
|
| 860 |
-
},1000,9000);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sd_feed/javascript/loradownload.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
| 1 |
-
|
| 2 |
-
waitForElementToDisplay(
|
| 3 |
-
"#lora-search-table",
|
| 4 |
-
function(){
|
| 5 |
-
const loraModel = {
|
| 6 |
-
data() {
|
| 7 |
-
return {
|
| 8 |
-
loraList: [],
|
| 9 |
-
loraString: '',
|
| 10 |
-
}
|
| 11 |
-
},
|
| 12 |
-
methods: {
|
| 13 |
-
setUrlData(url, fname){
|
| 14 |
-
const textArea = gradioApp().querySelector("#lora-download-url")
|
| 15 |
-
textArea.value = url;
|
| 16 |
-
const fnameInput = gradioApp().querySelector("#lora-filename")
|
| 17 |
-
fnameInput.value = fname;
|
| 18 |
-
const downloadBtn = gradioApp().querySelector('#lora_download_btn');
|
| 19 |
-
downloadBtn.click();
|
| 20 |
-
}
|
| 21 |
-
},
|
| 22 |
-
mounted(){
|
| 23 |
-
var self = this;
|
| 24 |
-
const textArea = gradioApp().querySelector("#table-data").querySelector('textarea');
|
| 25 |
-
const searchLoraBtn = gradioApp().querySelector("#lora_search_button");
|
| 26 |
-
const tableArea = gradioApp().querySelector("#table-data");
|
| 27 |
-
searchLoraBtn.addEventListener('click', (e)=>{
|
| 28 |
-
|
| 29 |
-
const interval = 500; // 1 second
|
| 30 |
-
const duration = 15000; // 15 seconds
|
| 31 |
-
let count = 0;
|
| 32 |
-
const timer = setInterval(() => {
|
| 33 |
-
// Perform your desired actions here
|
| 34 |
-
count += interval;
|
| 35 |
-
const textArea = gradioApp().querySelector("#table-data").querySelector('textarea');
|
| 36 |
-
const textAreaValue = textArea.value;
|
| 37 |
-
let newJson;
|
| 38 |
-
try{
|
| 39 |
-
newJson = JSON.parse(textAreaValue.replace('(','[').replace(',)', ')').replace(')',']').replaceAll("'", '"'));
|
| 40 |
-
}catch(e){
|
| 41 |
-
console.log(e);
|
| 42 |
-
newJson = [];
|
| 43 |
-
}
|
| 44 |
-
if (textAreaValue !== self.loraString||count >= duration) {
|
| 45 |
-
self.loraString = textAreaValue;
|
| 46 |
-
self.loraList = newJson;
|
| 47 |
-
clearInterval(timer);
|
| 48 |
-
}
|
| 49 |
-
}, interval);
|
| 50 |
-
});
|
| 51 |
-
},
|
| 52 |
-
};
|
| 53 |
-
const loraApp = Vue.createApp(loraModel);
|
| 54 |
-
loraApp.mount(gradioApp().querySelector("#lora-search-table"));
|
| 55 |
-
},1000,9000);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sd_feed/javascript/userprofile.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
| 1 |
-
waitForElementToDisplay(
|
| 2 |
-
"#feed-profile-tab",
|
| 3 |
-
function(){
|
| 4 |
-
const userModel = {
|
| 5 |
-
data() {
|
| 6 |
-
return {
|
| 7 |
-
userId: '',
|
| 8 |
-
nickname: '',
|
| 9 |
-
likeCount: 0,
|
| 10 |
-
editMode: false,
|
| 11 |
-
loading: false,
|
| 12 |
-
}
|
| 13 |
-
},
|
| 14 |
-
methods: {
|
| 15 |
-
close() {},
|
| 16 |
-
mounted(){},
|
| 17 |
-
beforeDestroy(){},
|
| 18 |
-
setEditMode(){
|
| 19 |
-
this.editMode = !this.editMode;
|
| 20 |
-
},
|
| 21 |
-
saveNickname(){
|
| 22 |
-
const userId = localStorage.getItem("userId");
|
| 23 |
-
const token = localStorage.getItem("token");
|
| 24 |
-
const headers={"Authorization":"Token " + token};
|
| 25 |
-
axios.post(
|
| 26 |
-
`https://newtypev3-server-vjiloyvjvq-an.a.run.app/user/profile`,
|
| 27 |
-
{
|
| 28 |
-
userId,
|
| 29 |
-
nickname: this.nickname,
|
| 30 |
-
},
|
| 31 |
-
{
|
| 32 |
-
headers
|
| 33 |
-
}
|
| 34 |
-
)
|
| 35 |
-
.then(response => {
|
| 36 |
-
this.editMode = false;
|
| 37 |
-
})
|
| 38 |
-
.catch(error => {
|
| 39 |
-
this.loading = false;
|
| 40 |
-
alert(error.response.data.detail);
|
| 41 |
-
})
|
| 42 |
-
},
|
| 43 |
-
|
| 44 |
-
},
|
| 45 |
-
created() {
|
| 46 |
-
const userId = localStorage.getItem("userId");
|
| 47 |
-
const token = localStorage.getItem("token");
|
| 48 |
-
const headers={"Authorization":"Token " + token};
|
| 49 |
-
axios.get(
|
| 50 |
-
`https://newtypev3-server-vjiloyvjvq-an.a.run.app/user/profile/${userId}`,
|
| 51 |
-
{
|
| 52 |
-
headers
|
| 53 |
-
}
|
| 54 |
-
)
|
| 55 |
-
.then(response => {
|
| 56 |
-
const dataObject = response.data;;
|
| 57 |
-
this.likeCount = dataObject.likecount;
|
| 58 |
-
this.nickname = dataObject.nickname;
|
| 59 |
-
this.userId = userId;
|
| 60 |
-
}).catch(error => {
|
| 61 |
-
this.loading = false;
|
| 62 |
-
console.log(error)
|
| 63 |
-
})
|
| 64 |
-
},
|
| 65 |
-
};
|
| 66 |
-
const fetchApp = Vue.createApp(userModel);
|
| 67 |
-
if (document.querySelector("#feed-profile-tab") != null) {
|
| 68 |
-
fetchApp.mount('#feed-profile-tab');
|
| 69 |
-
}else{
|
| 70 |
-
fetchApp.mount(document.getElementsByTagName("gradio-app")[0].shadowRoot.getElementById("feed-profile-tab"));
|
| 71 |
-
}
|
| 72 |
-
|
| 73 |
-
console.log("mount success");
|
| 74 |
-
},1000,9000);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sd_feed/javascript/vue.global.js
DELETED
|
The diff for this file is too large to render.
See raw diff
|
|
|
sd_feed/newtype_v3/__init__.py
DELETED
|
File without changes
|
sd_feed/newtype_v3/__pycache__/__init__.cpython-310.pyc
DELETED
|
Binary file (158 Bytes)
|
|
|
sd_feed/newtype_v3/__pycache__/images.cpython-310.pyc
DELETED
|
Binary file (6.46 kB)
|
|
|
sd_feed/newtype_v3/__pycache__/locs.cpython-310.pyc
DELETED
|
Binary file (514 Bytes)
|
|
|
sd_feed/newtype_v3/__pycache__/lora.cpython-310.pyc
DELETED
|
Binary file (1.1 kB)
|
|
|
sd_feed/newtype_v3/__pycache__/lora_types.cpython-310.pyc
DELETED
|
Binary file (313 Bytes)
|
|
|
sd_feed/newtype_v3/__pycache__/newtype_v3.cpython-310.pyc
DELETED
|
Binary file (8.64 kB)
|
|
|
sd_feed/newtype_v3/__pycache__/users.cpython-310.pyc
DELETED
|
Binary file (1.31 kB)
|
|
|
sd_feed/newtype_v3/images.py
DELETED
|
@@ -1,279 +0,0 @@
|
|
| 1 |
-
import json
|
| 2 |
-
import os
|
| 3 |
-
from typing import Dict, List, Optional
|
| 4 |
-
import re
|
| 5 |
-
import base64
|
| 6 |
-
from io import BytesIO
|
| 7 |
-
from tempfile import _TemporaryFileWrapper
|
| 8 |
-
import traceback
|
| 9 |
-
|
| 10 |
-
from modules.images import read_info_from_image
|
| 11 |
-
from newtype_v3.users import create_user
|
| 12 |
-
from newtype_v3.utils.string_utils import return_string_dict
|
| 13 |
-
from newtype_v3.locs import DEFAULT_LOC
|
| 14 |
-
|
| 15 |
-
from PIL import Image
|
| 16 |
-
from modules.processing import StableDiffusionProcessing
|
| 17 |
-
import requests
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
def dumper(obj):
|
| 21 |
-
try:
|
| 22 |
-
return obj.toJSON()
|
| 23 |
-
except Exception:
|
| 24 |
-
try:
|
| 25 |
-
return obj.__dict__
|
| 26 |
-
except Exception:
|
| 27 |
-
return str(obj)
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
def create_image(img: Image, user_id: str, process: StableDiffusionProcessing, info: Optional[str] = None, token: str = ''):
|
| 31 |
-
try:
|
| 32 |
-
if info:
|
| 33 |
-
data_dict = return_string_dict(info)
|
| 34 |
-
else:
|
| 35 |
-
applied_to_hires = (
|
| 36 |
-
getattr(process, 'applied_old_hires_behavior_to')
|
| 37 |
-
if hasattr(process, 'applied_old_hires_behavior_to')
|
| 38 |
-
else None
|
| 39 |
-
)
|
| 40 |
-
enable_hr = (
|
| 41 |
-
getattr(process, 'enable_hr')
|
| 42 |
-
if hasattr(process, 'enable_hr')
|
| 43 |
-
else None
|
| 44 |
-
)
|
| 45 |
-
|
| 46 |
-
data_dict = {
|
| 47 |
-
'all_negative_prompts': process.all_negative_prompts,
|
| 48 |
-
'all_prompts': process.all_prompts,
|
| 49 |
-
'all_seeds': process.all_seeds,
|
| 50 |
-
'all_subseeds': process.all_subseeds,
|
| 51 |
-
'applied_old_hires_behavior_to': applied_to_hires,
|
| 52 |
-
'batch_size': process.batch_size,
|
| 53 |
-
'cfg_scale': process.cfg_scale,
|
| 54 |
-
'color_corrections': process.color_corrections,
|
| 55 |
-
'ddim_discretize': process.ddim_discretize,
|
| 56 |
-
'denoising_strength': process.denoising_strength,
|
| 57 |
-
'disable_extra_networks': process.disable_extra_networks,
|
| 58 |
-
'do_not_reload_embeddings': process.do_not_reload_embeddings,
|
| 59 |
-
'do_not_save_grid': process.do_not_save_grid,
|
| 60 |
-
'do_not_save_samples': process.do_not_save_samples,
|
| 61 |
-
'enable_hr': enable_hr,
|
| 62 |
-
'eta': process.eta,
|
| 63 |
-
'extra_generation_params': process.extra_generation_params,
|
| 64 |
-
'height': process.height,
|
| 65 |
-
'iteration': process.iteration,
|
| 66 |
-
'n_iter': process.n_iter,
|
| 67 |
-
'negative_prompt': process.negative_prompt,
|
| 68 |
-
'outpath_grids': process.outpath_grids,
|
| 69 |
-
'outpath_samples': process.outpath_samples,
|
| 70 |
-
'overlay_images': process.overlay_images,
|
| 71 |
-
'override_settings': process.override_settings,
|
| 72 |
-
'override_settings_restore_afterwards':
|
| 73 |
-
process.override_settings_restore_afterwards,
|
| 74 |
-
'process': process.paste_to,
|
| 75 |
-
'prompt': process.prompt,
|
| 76 |
-
'prompt_for_display': process.prompt_for_display,
|
| 77 |
-
'restore_faces': process.restore_faces,
|
| 78 |
-
's_churn': process.s_churn,
|
| 79 |
-
's_noise': process.s_noise,
|
| 80 |
-
's_tmax': process.s_tmax,
|
| 81 |
-
's_tmin': process.s_tmin,
|
| 82 |
-
'sampler_name': process.sampler_name,
|
| 83 |
-
'sampler_noise_scheduler_override':
|
| 84 |
-
process.sampler_noise_scheduler_override,
|
| 85 |
-
'script_args': process.script_args,
|
| 86 |
-
'scripts': [x.title() for x in process.scripts.scripts],
|
| 87 |
-
'sd_model': process.sd_model.sd_checkpoint_info.title,
|
| 88 |
-
'seed': process.seed,
|
| 89 |
-
'seed_resize_from_h': process.seed_resize_from_h,
|
| 90 |
-
'seed_resize_from_w': process.seed_resize_from_w,
|
| 91 |
-
'steps': process.steps,
|
| 92 |
-
'styles': process.styles,
|
| 93 |
-
'subseed': process.subseed,
|
| 94 |
-
'subseed_strength': process.subseed_strength,
|
| 95 |
-
}
|
| 96 |
-
for row in [
|
| 97 |
-
'hr_resize_x',
|
| 98 |
-
'hr_resize_y',
|
| 99 |
-
'hr_scale',
|
| 100 |
-
'hr_second_pass_steps',
|
| 101 |
-
'hr_upscale_to_x',
|
| 102 |
-
'hr_upscale_to_y',
|
| 103 |
-
'hr_upscaler',
|
| 104 |
-
'tiling',
|
| 105 |
-
'truncate_x',
|
| 106 |
-
'truncate_y',
|
| 107 |
-
'width'
|
| 108 |
-
]:
|
| 109 |
-
value = (
|
| 110 |
-
getattr(process, row)
|
| 111 |
-
if hasattr(process, row)
|
| 112 |
-
else None
|
| 113 |
-
)
|
| 114 |
-
data_dict[row] = value
|
| 115 |
-
img.save(f'{DEFAULT_LOC}/temp.png', "PNG", optimize=True)
|
| 116 |
-
img.seek(0)
|
| 117 |
-
_ = requests.post(
|
| 118 |
-
'https://newtypev3-server-vjiloyvjvq-an.a.run.app/image/image',
|
| 119 |
-
data={
|
| 120 |
-
'userId': user_id,
|
| 121 |
-
'metadata': json.dumps(data_dict, default=dumper)
|
| 122 |
-
},
|
| 123 |
-
files={
|
| 124 |
-
'upload_file': open(f'{DEFAULT_LOC}/temp.png', 'rb')
|
| 125 |
-
},
|
| 126 |
-
stream=True,
|
| 127 |
-
headers={
|
| 128 |
-
'Authorization': f'Token {token}'
|
| 129 |
-
}
|
| 130 |
-
)
|
| 131 |
-
os.remove(f'{DEFAULT_LOC}/temp.png')
|
| 132 |
-
except Exception as e:
|
| 133 |
-
print(e)
|
| 134 |
-
pass
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
def create_image_from_string(img_string: str, user_id: str, token: str = ''):
|
| 138 |
-
try:
|
| 139 |
-
remove_image = False
|
| 140 |
-
if img_string.startswith("http") or img_string.startswith("file="):
|
| 141 |
-
file_loc = (
|
| 142 |
-
re.search(r'file=(.*)', img_string).group(1)
|
| 143 |
-
.replace("%20", ' ')
|
| 144 |
-
)
|
| 145 |
-
img = Image.open(file_loc)
|
| 146 |
-
text_info, extra_items = read_info_from_image(img)
|
| 147 |
-
data_dict = return_string_dict(text_info)
|
| 148 |
-
data_dict.update(extra_items)
|
| 149 |
-
else:
|
| 150 |
-
file_loc = f'{DEFAULT_LOC}/temp.png'
|
| 151 |
-
img_string = img_string.split(",")[1]
|
| 152 |
-
img = Image.open(BytesIO(base64.b64decode(img_string)))
|
| 153 |
-
img.save(file_loc, "PNG", optimize=True)
|
| 154 |
-
img.seek(0)
|
| 155 |
-
remove_image = True
|
| 156 |
-
|
| 157 |
-
_ = requests.post(
|
| 158 |
-
'https://newtypev3-server-vjiloyvjvq-an.a.run.app/image/image',
|
| 159 |
-
data={
|
| 160 |
-
'userId': user_id,
|
| 161 |
-
'metadata': json.dumps(data_dict, default=dumper)
|
| 162 |
-
},
|
| 163 |
-
files={
|
| 164 |
-
'upload_file': open(file_loc, 'rb')
|
| 165 |
-
},
|
| 166 |
-
stream=True,
|
| 167 |
-
headers={
|
| 168 |
-
'Authorization': f'Token {token}'
|
| 169 |
-
}
|
| 170 |
-
)
|
| 171 |
-
try:
|
| 172 |
-
if remove_image:
|
| 173 |
-
os.remove(file_loc)
|
| 174 |
-
except Exception:
|
| 175 |
-
pass
|
| 176 |
-
return True
|
| 177 |
-
except Exception as e:
|
| 178 |
-
print(e, traceback.format_exc())
|
| 179 |
-
return False
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
def create_image_to_image_file(
|
| 183 |
-
img_string: str, original_img_string: str, user_id: str,
|
| 184 |
-
token: str = ''
|
| 185 |
-
):
|
| 186 |
-
try:
|
| 187 |
-
remove_image = False
|
| 188 |
-
if img_string.startswith("http") or img_string.startswith("file="):
|
| 189 |
-
file_loc = (
|
| 190 |
-
re.search(r'file=(.*)', img_string).group(1)
|
| 191 |
-
.replace("%20", ' ')
|
| 192 |
-
)
|
| 193 |
-
img = Image.open(file_loc)
|
| 194 |
-
text_info, extra_items = read_info_from_image(img)
|
| 195 |
-
data_dict = return_string_dict(text_info)
|
| 196 |
-
data_dict.update(extra_items)
|
| 197 |
-
else:
|
| 198 |
-
file_loc = f'{DEFAULT_LOC}/temp.png'
|
| 199 |
-
img_string = img_string.split(",")[1]
|
| 200 |
-
img = Image.open(BytesIO(base64.b64decode(img_string)))
|
| 201 |
-
img.save(file_loc, "PNG", optimize=True)
|
| 202 |
-
img.seek(0)
|
| 203 |
-
remove_image = True
|
| 204 |
-
origin_loc = f'{DEFAULT_LOC}/temp2.png'
|
| 205 |
-
original_img_string = original_img_string.split(',')[1]
|
| 206 |
-
img = Image.open(BytesIO(base64.b64decode(original_img_string)))
|
| 207 |
-
img.save(origin_loc, "PNG", optimize=True)
|
| 208 |
-
_ = requests.post(
|
| 209 |
-
'https://newtypev3-server-vjiloyvjvq-an.a.run.app/image/image',
|
| 210 |
-
data={
|
| 211 |
-
'userId': user_id,
|
| 212 |
-
'metadata': json.dumps(data_dict, default=dumper)
|
| 213 |
-
},
|
| 214 |
-
files={
|
| 215 |
-
'upload_file': open(file_loc, 'rb'),
|
| 216 |
-
'img_to_img_file': open(origin_loc, 'rb')
|
| 217 |
-
},
|
| 218 |
-
stream=True,
|
| 219 |
-
headers={
|
| 220 |
-
'Authorization': f'Token {token}'
|
| 221 |
-
}
|
| 222 |
-
)
|
| 223 |
-
try:
|
| 224 |
-
if remove_image:
|
| 225 |
-
os.remove(file_loc)
|
| 226 |
-
os.remove(origin_loc)
|
| 227 |
-
except Exception:
|
| 228 |
-
pass
|
| 229 |
-
return True
|
| 230 |
-
except Exception as e:
|
| 231 |
-
print('Image to image save error', e)
|
| 232 |
-
return False
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
def create_image_from_img(img: Image, user_id: str, data_dict: Dict, token: str = ''):
|
| 236 |
-
try:
|
| 237 |
-
file_loc = f'{DEFAULT_LOC}/temp.png'
|
| 238 |
-
img.save(file_loc, "PNG", optimize=True)
|
| 239 |
-
img.seek(0)
|
| 240 |
-
_ = requests.post(
|
| 241 |
-
'https://newtypev3-server-vjiloyvjvq-an.a.run.app/image/image',
|
| 242 |
-
data={
|
| 243 |
-
'userId': user_id,
|
| 244 |
-
'metadata': json.dumps(data_dict, default=dumper)
|
| 245 |
-
},
|
| 246 |
-
files={
|
| 247 |
-
'upload_file': open(file_loc, 'rb')
|
| 248 |
-
},
|
| 249 |
-
stream=True,
|
| 250 |
-
headers={
|
| 251 |
-
'Authorization': f'Token {token}'
|
| 252 |
-
}
|
| 253 |
-
)
|
| 254 |
-
os.remove(file_loc)
|
| 255 |
-
except Exception as e:
|
| 256 |
-
print(e)
|
| 257 |
-
pass
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
def create_multiple_file_uploads(
|
| 261 |
-
data: List[_TemporaryFileWrapper]
|
| 262 |
-
):
|
| 263 |
-
user_dict = create_user()
|
| 264 |
-
user_id = user_dict.get('userId')
|
| 265 |
-
for d in data:
|
| 266 |
-
try:
|
| 267 |
-
image = Image.open(BytesIO(d))
|
| 268 |
-
textinfo, items = read_info_from_image(image)
|
| 269 |
-
if textinfo is not None:
|
| 270 |
-
data = return_string_dict(textinfo)
|
| 271 |
-
data.update(items)
|
| 272 |
-
else:
|
| 273 |
-
data = {}
|
| 274 |
-
create_image_from_img(image, user_id, data)
|
| 275 |
-
except Exception as e:
|
| 276 |
-
print(e)
|
| 277 |
-
pass
|
| 278 |
-
return []
|
| 279 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sd_feed/newtype_v3/locs.py
DELETED
|
@@ -1,10 +0,0 @@
|
|
| 1 |
-
import os
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
is_exists = os.path.exists('/content/repository/extensions-builtin')
|
| 5 |
-
is_exists_seconds = os.path.exists('/content/drive/MyDrive/SD/extensions/sd_feed/javascript')
|
| 6 |
-
SD_ROOT = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
|
| 7 |
-
if is_exists and is_exists_seconds:
|
| 8 |
-
DEFAULT_LOC = '/content/drive/MyDrive/SD/extensions/sd_feed'
|
| 9 |
-
else:
|
| 10 |
-
DEFAULT_LOC = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sd_feed/newtype_v3/lora.py
DELETED
|
@@ -1,32 +0,0 @@
|
|
| 1 |
-
import re
|
| 2 |
-
import traceback
|
| 3 |
-
from typing import List, Dict
|
| 4 |
-
import requests
|
| 5 |
-
from newtype_v3.users import create_user_headers
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
def lora_string_list(prompt: str) -> List[str]:
|
| 9 |
-
data_list = []
|
| 10 |
-
for x in re.findall(r'\<lora\:.+?.\>', prompt):
|
| 11 |
-
data_list.append(x.split(':')[1])
|
| 12 |
-
return data_list
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
def search_lora_list(lora_list: List[str]) -> List[Dict]:
|
| 16 |
-
try:
|
| 17 |
-
headers, user_dict = create_user_headers()
|
| 18 |
-
result_list = requests.post(
|
| 19 |
-
'https://newtypev3-server-vjiloyvjvq-an.a.run.app/lora/loras',
|
| 20 |
-
json={
|
| 21 |
-
'loraList': lora_list,
|
| 22 |
-
'userId': user_dict.get("userId")
|
| 23 |
-
},
|
| 24 |
-
headers=headers
|
| 25 |
-
)
|
| 26 |
-
result = result_list.json()
|
| 27 |
-
if type(result) is list:
|
| 28 |
-
return result
|
| 29 |
-
raise ValueError(result)
|
| 30 |
-
except Exception as e:
|
| 31 |
-
print(e, traceback.format_exc())
|
| 32 |
-
return False
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sd_feed/newtype_v3/lora_types.py
DELETED
|
@@ -1,7 +0,0 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
SIMILAR: str = "SIMILAR"
|
| 4 |
-
SAME: str = "SAME"
|
| 5 |
-
NOT_FOUND: str = "NOT_FOUND"
|
| 6 |
-
ALREADY_EXISTS: str = "ALREADY_EXSITS"
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sd_feed/newtype_v3/newtype_v3.py
DELETED
|
@@ -1,293 +0,0 @@
|
|
| 1 |
-
import logging
|
| 2 |
-
from pathlib import Path
|
| 3 |
-
from typing import List, Tuple
|
| 4 |
-
import requests
|
| 5 |
-
import os
|
| 6 |
-
|
| 7 |
-
import gradio as gr
|
| 8 |
-
|
| 9 |
-
from modules import call_queue
|
| 10 |
-
from modules import scripts, script_callbacks
|
| 11 |
-
from modules.script_callbacks import ImageSaveParams
|
| 12 |
-
from modules import shared
|
| 13 |
-
|
| 14 |
-
from newtype_v3.locs import DEFAULT_LOC
|
| 15 |
-
from newtype_v3.lora import search_lora_list, lora_string_list
|
| 16 |
-
from . import lora_types
|
| 17 |
-
from .users import create_user, create_user_headers
|
| 18 |
-
from .images import (
|
| 19 |
-
create_image, create_image_from_string, create_image_to_image_file
|
| 20 |
-
)
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
logger = logging.getLogger(__name__)
|
| 24 |
-
|
| 25 |
-
loaded_count = 0
|
| 26 |
-
|
| 27 |
-
base_dir = Path(scripts.basedir())
|
| 28 |
-
all_btns: List[Tuple[gr.Button, ...]] = []
|
| 29 |
-
share_image = False
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
def search_lora(prompt: str) -> List[str]:
|
| 33 |
-
if type(prompt) is not str:
|
| 34 |
-
prompt = prompt[0]
|
| 35 |
-
search_list = lora_string_list(prompt)
|
| 36 |
-
try:
|
| 37 |
-
list_of_dict = search_lora_list(search_list)
|
| 38 |
-
except Exception:
|
| 39 |
-
list_of_dict = []
|
| 40 |
-
fname_list = os.listdir(shared.cmd_opts.lora_dir)
|
| 41 |
-
fname_text_list = [
|
| 42 |
-
x.replace(".safetensors", '').replace('.ckpt', '').replace(".pt", '')
|
| 43 |
-
for x in fname_list
|
| 44 |
-
]
|
| 45 |
-
searched_list = [
|
| 46 |
-
x.get('fileName').replace(".safetensors", '').replace('.ckpt', '').replace(".pt", '')
|
| 47 |
-
for x in list_of_dict
|
| 48 |
-
]
|
| 49 |
-
not_found_list = [{
|
| 50 |
-
'fileName': x,
|
| 51 |
-
'downloadUrl': '',
|
| 52 |
-
'status': lora_types.NOT_FOUND
|
| 53 |
-
} for x in search_list
|
| 54 |
-
if x.replace(".safetensor", '').replace('.ckpt', '').replace(".pt", '')
|
| 55 |
-
not in fname_text_list
|
| 56 |
-
and
|
| 57 |
-
x not in searched_list
|
| 58 |
-
]
|
| 59 |
-
list_of_dict = list(filter(lambda x: x.get('fileName') not in fname_list, list_of_dict))
|
| 60 |
-
list_of_dict = [
|
| 61 |
-
{
|
| 62 |
-
'fileName': x.get('fileName'), 'downloadUrl': x.get('downloadUrl'),
|
| 63 |
-
'status': lora_types.SAME,
|
| 64 |
-
}
|
| 65 |
-
for x in list_of_dict
|
| 66 |
-
]
|
| 67 |
-
return list_of_dict + not_found_list
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
def set_share_image(x):
|
| 71 |
-
global share_image
|
| 72 |
-
share_image = x
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
def save_files(image_file: str, outer_html) -> List[str]:
|
| 76 |
-
user_dict = create_user()
|
| 77 |
-
userId = user_dict.get('userId')
|
| 78 |
-
result = create_image_from_string(
|
| 79 |
-
image_file,
|
| 80 |
-
userId,
|
| 81 |
-
)
|
| 82 |
-
result_string = "Success" if result else "Failed"
|
| 83 |
-
return [
|
| 84 |
-
result_string
|
| 85 |
-
]
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
def download_lora(link, fname):
|
| 89 |
-
# Code to handle file download
|
| 90 |
-
response = requests.get(link)
|
| 91 |
-
with open(f'{shared.cmd_opts.lora_dir}/{fname}', 'wb') as f:
|
| 92 |
-
f.write(response.content)
|
| 93 |
-
try:
|
| 94 |
-
headers, user_dict = create_user_headers()
|
| 95 |
-
_ = requests.post(
|
| 96 |
-
'https://newtypev3-server-vjiloyvjvq-an.a.run.app/lora/download',
|
| 97 |
-
json={
|
| 98 |
-
'userId': user_dict.get("userId")
|
| 99 |
-
},
|
| 100 |
-
headers=headers
|
| 101 |
-
)
|
| 102 |
-
except Exception:
|
| 103 |
-
pass
|
| 104 |
-
return ["Success"]
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
def save_imgto_img_file(
|
| 108 |
-
image_file: str, original_img_string: str, outer_html: str
|
| 109 |
-
):
|
| 110 |
-
user_dict = create_user()
|
| 111 |
-
userId = user_dict.get('userId')
|
| 112 |
-
token = user_dict.get('token', '')
|
| 113 |
-
result = create_image_to_image_file(
|
| 114 |
-
image_file,
|
| 115 |
-
original_img_string,
|
| 116 |
-
userId,
|
| 117 |
-
token=token
|
| 118 |
-
)
|
| 119 |
-
result_string = "Success" if result else "Failed"
|
| 120 |
-
return [result_string]
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
def register_png_posturl() -> None:
|
| 124 |
-
def on_img_save_url(image_save_params: ImageSaveParams) -> None:
|
| 125 |
-
try:
|
| 126 |
-
global share_image
|
| 127 |
-
if share_image:
|
| 128 |
-
user_dict = create_user()
|
| 129 |
-
userId = user_dict.get('userId')
|
| 130 |
-
create_image(
|
| 131 |
-
image_save_params.image,
|
| 132 |
-
userId,
|
| 133 |
-
image_save_params.p,
|
| 134 |
-
info=image_save_params.pnginfo.get("parameters") if image_save_params.pnginfo else None,
|
| 135 |
-
token=user_dict.get('token', ''),
|
| 136 |
-
)
|
| 137 |
-
except Exception:
|
| 138 |
-
logger.exception("Error save data")
|
| 139 |
-
script_callbacks.on_image_saved(on_img_save_url)
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
class Script(scripts.Script):
|
| 143 |
-
def __init__(self):
|
| 144 |
-
global loaded_count
|
| 145 |
-
|
| 146 |
-
loaded_count += 1
|
| 147 |
-
|
| 148 |
-
# This is a hack to make sure that the script is only loaded once
|
| 149 |
-
# Auto1111 calls the script twice, once for the txt2img and once for
|
| 150 |
-
# img2img
|
| 151 |
-
# These callbacks should only be registered once.
|
| 152 |
-
|
| 153 |
-
# When the Reload UI button in the settings tab is pressed, the script
|
| 154 |
-
# is loaded twice again
|
| 155 |
-
# Therefore we only register callbacks every second time the script is
|
| 156 |
-
# loaded
|
| 157 |
-
if loaded_count % 2 == 0:
|
| 158 |
-
return
|
| 159 |
-
register_png_posturl()
|
| 160 |
-
|
| 161 |
-
def title(self):
|
| 162 |
-
return "Feed"
|
| 163 |
-
|
| 164 |
-
def show(self, is_img2img):
|
| 165 |
-
return scripts.AlwaysVisible
|
| 166 |
-
|
| 167 |
-
def process(
|
| 168 |
-
self,
|
| 169 |
-
p,
|
| 170 |
-
*args,
|
| 171 |
-
**kwargs
|
| 172 |
-
):
|
| 173 |
-
return p
|
| 174 |
-
|
| 175 |
-
def after_component(self, component, **kwargs):
|
| 176 |
-
if isinstance(component, gr.HTML):
|
| 177 |
-
if component.elem_id in {'html_info_txt2img'}:
|
| 178 |
-
with open(f'{DEFAULT_LOC}/html/potd.html', encoding='utf-8') as f:
|
| 179 |
-
gr.HTML(
|
| 180 |
-
f.read(),
|
| 181 |
-
elem_id="best-product-tab",
|
| 182 |
-
)
|
| 183 |
-
|
| 184 |
-
if component.elem_id in {'txt2img_override_settings'}:
|
| 185 |
-
with gr.Accordion('Lora Downloads', open=True):
|
| 186 |
-
with gr.Column():
|
| 187 |
-
with gr.Row():
|
| 188 |
-
lora_save = gr.Button(
|
| 189 |
-
'Search Lora', elem_id='lora_search_button'
|
| 190 |
-
)
|
| 191 |
-
# JS에서 브라우저에있는데이터를 save_files함수로 전송
|
| 192 |
-
js_string = """(a)=>{
|
| 193 |
-
const container = gradioApp().querySelector('#txt2img_prompt');
|
| 194 |
-
const textArea = container.getElementsByTagName("textarea")[0];
|
| 195 |
-
return [textArea.value];
|
| 196 |
-
}"""
|
| 197 |
-
txtArea = gr.TextArea(
|
| 198 |
-
'',
|
| 199 |
-
elem_id="table-data",
|
| 200 |
-
visible=False
|
| 201 |
-
)
|
| 202 |
-
lora_download = gr.Button(
|
| 203 |
-
'', elem_id='lora_download_btn',
|
| 204 |
-
visible=False
|
| 205 |
-
)
|
| 206 |
-
download_results = gr.Textbox(
|
| 207 |
-
"",
|
| 208 |
-
label="",
|
| 209 |
-
visible=True
|
| 210 |
-
)
|
| 211 |
-
with open(f'{DEFAULT_LOC}/html/lora.html', encoding='utf-8') as f:
|
| 212 |
-
gr.HTML(f.read(), elem_id="lora-elem")
|
| 213 |
-
lora_save.click(
|
| 214 |
-
fn=call_queue.wrap_gradio_call(search_lora),
|
| 215 |
-
_js=js_string,
|
| 216 |
-
inputs=[lora_save],
|
| 217 |
-
outputs=txtArea,
|
| 218 |
-
show_progress=True,
|
| 219 |
-
)
|
| 220 |
-
download_js_string = """(a)=>{
|
| 221 |
-
const container = gradioApp().querySelector('#lora-download-url');
|
| 222 |
-
const lorafname = gradioApp().querySelector('#lora-filename');
|
| 223 |
-
return [container.value, lorafname.value];
|
| 224 |
-
}"""
|
| 225 |
-
lora_download.click(
|
| 226 |
-
fn=call_queue.wrap_gradio_call(download_lora),
|
| 227 |
-
_js=download_js_string,
|
| 228 |
-
inputs=[lora_download, lora_download],
|
| 229 |
-
outputs=[download_results],
|
| 230 |
-
show_progress=True,
|
| 231 |
-
)
|
| 232 |
-
|
| 233 |
-
if isinstance(component, gr.Gallery):
|
| 234 |
-
if component.elem_id in {'txt2img_gallery'}:
|
| 235 |
-
with gr.Accordion('Feed Settings', open=True):
|
| 236 |
-
with gr.Column():
|
| 237 |
-
with gr.Row():
|
| 238 |
-
save = gr.Button(
|
| 239 |
-
'Share', elem_id='save_txt2_image'
|
| 240 |
-
)
|
| 241 |
-
with open(f'{DEFAULT_LOC}/html/profile.html', encoding='utf-8') as f:
|
| 242 |
-
gr.HTML(f.read(), elem_id="feed-profile-tab")
|
| 243 |
-
# JS에서 브라우저에있는데이터를 save_files함수로 전송
|
| 244 |
-
js_string = """(a)=>{
|
| 245 |
-
const el = gradioApp().querySelector('#txt2img_gallery');
|
| 246 |
-
const imgList = el.getElementsByTagName('img');
|
| 247 |
-
const htmlInfoTxtImg = gradioApp().querySelector('#html_info_txt2img');
|
| 248 |
-
return [imgList[0]['src'], htmlInfoTxtImg.outerHTML];
|
| 249 |
-
}"""
|
| 250 |
-
txt_to_txt_result = gr.Textbox(
|
| 251 |
-
"",
|
| 252 |
-
label="",
|
| 253 |
-
visible=True
|
| 254 |
-
)
|
| 255 |
-
save.click(
|
| 256 |
-
fn=call_queue.wrap_gradio_call(save_files),
|
| 257 |
-
_js=js_string,
|
| 258 |
-
inputs=[save, save],
|
| 259 |
-
outputs=[txt_to_txt_result],
|
| 260 |
-
show_progress=True,
|
| 261 |
-
)
|
| 262 |
-
if component.elem_id in {'img2img_gallery'}:
|
| 263 |
-
with gr.Accordion('Feed Settings', open=True):
|
| 264 |
-
with gr.Column():
|
| 265 |
-
save = gr.Button('Share', elem_id='save_img2_image')
|
| 266 |
-
img_to_img_result = gr.Textbox(
|
| 267 |
-
"",
|
| 268 |
-
label="",
|
| 269 |
-
visible=True
|
| 270 |
-
)
|
| 271 |
-
# JS에서 브라우저에있는데이터를 save_files함수로 전송
|
| 272 |
-
js_string = """(a)=>{
|
| 273 |
-
const el = gradioApp().querySelector('#img2img_gallery');
|
| 274 |
-
const elOrigin = gradioApp().querySelector("#img2img_image");
|
| 275 |
-
const imgList = el.getElementsByTagName('img');
|
| 276 |
-
const originImgList = elOrigin.getElementsByTagName('img');
|
| 277 |
-
const htmlInfoTxtImg = gradioApp().querySelector('#html_info_img2img');
|
| 278 |
-
return [imgList[0]['src'], originImgList[0]['src'], htmlInfoTxtImg.outerHTML];
|
| 279 |
-
}"""
|
| 280 |
-
save.click(
|
| 281 |
-
fn=call_queue.wrap_gradio_call(
|
| 282 |
-
save_imgto_img_file
|
| 283 |
-
),
|
| 284 |
-
_js=js_string,
|
| 285 |
-
inputs=[save, save, save],
|
| 286 |
-
outputs=[
|
| 287 |
-
img_to_img_result
|
| 288 |
-
],
|
| 289 |
-
show_progress=True,
|
| 290 |
-
)
|
| 291 |
-
|
| 292 |
-
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cpython-310.pyc
DELETED
|
Binary file (1.21 kB)
|
|
|
sd_feed/newtype_v3/tabs/feed.py
DELETED
|
@@ -1,26 +0,0 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
|
| 3 |
-
from newtype_v3.users import create_user
|
| 4 |
-
from newtype_v3.locs import DEFAULT_LOC
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
def on_ui_tabs():
|
| 8 |
-
user_dict = create_user()
|
| 9 |
-
userId = user_dict.get("userId")
|
| 10 |
-
token = user_dict.get("token")
|
| 11 |
-
script_html = f"""
|
| 12 |
-
<script>window.localStorage.setItem("userId", "{userId}");</script>
|
| 13 |
-
<script>window.localStorage.setItem("token", "{token}");</script>
|
| 14 |
-
"""
|
| 15 |
-
iframe_html = (
|
| 16 |
-
f"""<iframe style="width: 100%; height: 0px" srcdoc='{script_html}'>
|
| 17 |
-
</iframe>"""
|
| 18 |
-
)
|
| 19 |
-
with gr.Blocks() as newtype_tab:
|
| 20 |
-
with gr.Group(elem_id="dynamic-prompting"):
|
| 21 |
-
with gr.Row():
|
| 22 |
-
with gr.Column():
|
| 23 |
-
gr.HTML(iframe_html, elem_id="html_id")
|
| 24 |
-
with open(f'{DEFAULT_LOC}/html/feedtab.html', encoding='utf-8') as f:
|
| 25 |
-
gr.HTML(f.read(), elem_id="vue-elem")
|
| 26 |
-
return (newtype_tab, "Feed", "newtype_tab"),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sd_feed/newtype_v3/users.py
DELETED
|
@@ -1,48 +0,0 @@
|
|
| 1 |
-
import json
|
| 2 |
-
from typing import Dict, Tuple
|
| 3 |
-
import uuid
|
| 4 |
-
import requests
|
| 5 |
-
from newtype_v3.locs import DEFAULT_LOC
|
| 6 |
-
|
| 7 |
-
def create_user() -> Dict:
|
| 8 |
-
try:
|
| 9 |
-
with open(f'{DEFAULT_LOC}/user.json') as f:
|
| 10 |
-
user_dict = json.load(f)
|
| 11 |
-
user_id = user_dict.get('userId')
|
| 12 |
-
if not user_dict.get("token"):
|
| 13 |
-
post_dict = {
|
| 14 |
-
'userId': user_id,
|
| 15 |
-
'useAuth': True,
|
| 16 |
-
}
|
| 17 |
-
response = requests.post(
|
| 18 |
-
'https://newtypev3-server-vjiloyvjvq-an.a.run.app/user/user',
|
| 19 |
-
json=post_dict
|
| 20 |
-
)
|
| 21 |
-
token = response.json().get('token')
|
| 22 |
-
user_dict['token'] = token
|
| 23 |
-
with open(f'{DEFAULT_LOC}/user.json', 'w') as f:
|
| 24 |
-
json.dump(user_dict, f, sort_keys=True, indent=4)
|
| 25 |
-
return user_dict
|
| 26 |
-
except Exception:
|
| 27 |
-
userId = str(uuid.uuid4())
|
| 28 |
-
user_dict = {
|
| 29 |
-
'userId': userId,
|
| 30 |
-
'useAuth': True,
|
| 31 |
-
}
|
| 32 |
-
response = requests.post(
|
| 33 |
-
'https://newtypev3-server-vjiloyvjvq-an.a.run.app/user/user',
|
| 34 |
-
json=user_dict
|
| 35 |
-
)
|
| 36 |
-
token = response.json().get('token')
|
| 37 |
-
user_dict['token'] = token
|
| 38 |
-
with open(f'{DEFAULT_LOC}/user.json', 'w') as f:
|
| 39 |
-
json.dump(user_dict, f, sort_keys=True, indent=4)
|
| 40 |
-
return user_dict
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
def create_user_headers() -> Tuple[Dict, Dict]:
|
| 44 |
-
user_dict = create_user()
|
| 45 |
-
headers = {
|
| 46 |
-
"Authorization": f"Token {user_dict['token']}",
|
| 47 |
-
}
|
| 48 |
-
return headers, user_dict
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sd_feed/newtype_v3/utils/__init__.py
DELETED
|
File without changes
|
sd_feed/newtype_v3/utils/__pycache__/__init__.cpython-310.pyc
DELETED
|
Binary file (164 Bytes)
|
|
|
sd_feed/newtype_v3/utils/__pycache__/string_utils.cpython-310.pyc
DELETED
|
Binary file (1.3 kB)
|
|
|
sd_feed/newtype_v3/utils/string_utils.py
DELETED
|
@@ -1,40 +0,0 @@
|
|
| 1 |
-
import re
|
| 2 |
-
from typing import Optional, Dict
|
| 3 |
-
from copy import deepcopy
|
| 4 |
-
from PIL import Image
|
| 5 |
-
from modules.generation_parameters_copypaste import parse_generation_parameters
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
def return_file_loc(image_src: str) -> Image:
|
| 9 |
-
if image_src.startswith("http") or image_src.startswith("file="):
|
| 10 |
-
file_loc = (
|
| 11 |
-
re.search(r'file=(.*)', image_src).group(1)
|
| 12 |
-
.replace("%20", ' ')
|
| 13 |
-
)
|
| 14 |
-
return Image.open(file_loc)
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
def return_string_dict(image_src: str) -> Dict:
|
| 18 |
-
try:
|
| 19 |
-
original_data_dict = parse_generation_parameters(image_src)
|
| 20 |
-
data_dict = deepcopy(original_data_dict)
|
| 21 |
-
for key in original_data_dict.keys():
|
| 22 |
-
if key.lower() == 'model':
|
| 23 |
-
data_dict['sd_model'] = data_dict[key]
|
| 24 |
-
if key.lower() == 'steps':
|
| 25 |
-
data_dict['n_iter'] = data_dict[key]
|
| 26 |
-
if key.lower() == 'negative prompt':
|
| 27 |
-
data_dict['negative_prompt'] = data_dict[key]
|
| 28 |
-
if key.lower() == 'negative prompt':
|
| 29 |
-
data_dict['negative_prompt'] = data_dict[key]
|
| 30 |
-
if key.lower() == 'cfg scale':
|
| 31 |
-
data_dict['cfg_scale'] = data_dict[key]
|
| 32 |
-
if key.lower() == 'seed':
|
| 33 |
-
data_dict['seed'] = data_dict[key]
|
| 34 |
-
if key.lower() == 'prompt':
|
| 35 |
-
data_dict['prompt'] = data_dict[key]
|
| 36 |
-
if key.lower() == 'sampler':
|
| 37 |
-
data_dict['sampler'] = data_dict[key]
|
| 38 |
-
return data_dict
|
| 39 |
-
except Exception:
|
| 40 |
-
return {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sd_feed/requirements.txt
DELETED
|
@@ -1,2 +0,0 @@
|
|
| 1 |
-
browsercookie
|
| 2 |
-
bs4
|
|
|
|
|
|
|
|
|
sd_feed/scripts/__pycache__/main.cpython-310.pyc
DELETED
|
Binary file (828 Bytes)
|
|
|
sd_feed/scripts/main.py
DELETED
|
@@ -1,22 +0,0 @@
|
|
| 1 |
-
import os
|
| 2 |
-
from modules import script_callbacks
|
| 3 |
-
from newtype_v3.tabs import feed
|
| 4 |
-
from newtype_v3.locs import is_exists, is_exists_seconds
|
| 5 |
-
from newtype_v3.newtype_v3 import Script
|
| 6 |
-
import shutil
|
| 7 |
-
|
| 8 |
-
__all__ = ["Script"]
|
| 9 |
-
script_callbacks.on_ui_tabs(feed.on_ui_tabs)
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
if is_exists and is_exists_seconds:
|
| 13 |
-
shutil.copytree(
|
| 14 |
-
'/content/drive/MyDrive/SD/extensions/sd_feed/javascript',
|
| 15 |
-
'/content/repository/extensions-builtin/prompt-bracket-checker/javascript',
|
| 16 |
-
dirs_exist_ok=True
|
| 17 |
-
)
|
| 18 |
-
if not os.path.exists('/content/repository/extensions-builtin/LDSR/style.css'):
|
| 19 |
-
shutil.copy(
|
| 20 |
-
'/content/drive/MyDrive/SD/extensions/sd_feed/style.css',
|
| 21 |
-
'/content/repository/extensions-builtin/LDSR/style.css'
|
| 22 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sd_feed/style.css
DELETED
|
@@ -1,625 +0,0 @@
|
|
| 1 |
-
|
| 2 |
-
body {
|
| 3 |
-
min-height: 1000px;
|
| 4 |
-
}
|
| 5 |
-
#columns {
|
| 6 |
-
column-count: 4;
|
| 7 |
-
width: 100%;
|
| 8 |
-
max-width: 1100px;
|
| 9 |
-
margin: 50px auto;
|
| 10 |
-
column-gap: 4px;
|
| 11 |
-
}
|
| 12 |
-
.page-max-width{
|
| 13 |
-
max-width: 1100px !important;
|
| 14 |
-
width:100%;
|
| 15 |
-
}
|
| 16 |
-
.private-upload{
|
| 17 |
-
width:25%;
|
| 18 |
-
}
|
| 19 |
-
.item-author{
|
| 20 |
-
color:white !important;
|
| 21 |
-
}
|
| 22 |
-
@media screen and (max-width: 820px){
|
| 23 |
-
.private-upload{
|
| 24 |
-
width:100%;
|
| 25 |
-
max-width:420px;
|
| 26 |
-
}
|
| 27 |
-
#columns {
|
| 28 |
-
column-count: 2 !important;
|
| 29 |
-
}
|
| 30 |
-
}
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
@media screen and (max-width: 750px) {
|
| 34 |
-
#columns { column-gap: 0px; }
|
| 35 |
-
#columns figure { width: 100%; }
|
| 36 |
-
}
|
| 37 |
-
.product-heart-button{
|
| 38 |
-
position:absolute;
|
| 39 |
-
right:20px;
|
| 40 |
-
}
|
| 41 |
-
|
| 42 |
-
.product-slider {
|
| 43 |
-
position: relative;
|
| 44 |
-
}
|
| 45 |
-
#columns {
|
| 46 |
-
column-count: 4;
|
| 47 |
-
overflow: auto;
|
| 48 |
-
|
| 49 |
-
}
|
| 50 |
-
.filter-selector-tab{
|
| 51 |
-
display:flex;
|
| 52 |
-
}
|
| 53 |
-
.profile {
|
| 54 |
-
max-width: 800px;
|
| 55 |
-
margin: 0 auto;
|
| 56 |
-
font-family: Arial, sans-serif;
|
| 57 |
-
color: #333;
|
| 58 |
-
}
|
| 59 |
-
|
| 60 |
-
.header {
|
| 61 |
-
display: flex;
|
| 62 |
-
flex-direction: column;
|
| 63 |
-
align-items: center;
|
| 64 |
-
padding: 30px;
|
| 65 |
-
background-color: #f7f7f7;
|
| 66 |
-
}
|
| 67 |
-
|
| 68 |
-
.header img {
|
| 69 |
-
width: 150px;
|
| 70 |
-
height: 150px;
|
| 71 |
-
border-radius: 50%;
|
| 72 |
-
object-fit: cover;
|
| 73 |
-
object-position: center;
|
| 74 |
-
margin-bottom: 20px;
|
| 75 |
-
}
|
| 76 |
-
.header h1 {
|
| 77 |
-
font-size: 36px;
|
| 78 |
-
}
|
| 79 |
-
.rounded-pill{
|
| 80 |
-
border-radius: 50rem;
|
| 81 |
-
}
|
| 82 |
-
.btn:not(:disabled):not(.disabled) {
|
| 83 |
-
cursor: pointer;
|
| 84 |
-
}
|
| 85 |
-
.px-4 {
|
| 86 |
-
padding-right: 1.5rem!important;
|
| 87 |
-
padding-left: 1.5rem!important;
|
| 88 |
-
}
|
| 89 |
-
.border-secondary {
|
| 90 |
-
--bs-border-opacity: 1;
|
| 91 |
-
border-color: rgba(108,117,125,1)!important;
|
| 92 |
-
}
|
| 93 |
-
@font-face {
|
| 94 |
-
font-family: 'Material Icons';
|
| 95 |
-
font-style: normal;
|
| 96 |
-
font-weight: 400;
|
| 97 |
-
src: url(https://fonts.gstatic.com/s/materialicons/v140/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2) format('woff2');
|
| 98 |
-
}
|
| 99 |
-
|
| 100 |
-
.material-icons {
|
| 101 |
-
font-family: 'Material Icons';
|
| 102 |
-
font-weight: normal;
|
| 103 |
-
font-style: normal;
|
| 104 |
-
font-size: 24px;
|
| 105 |
-
line-height: 1;
|
| 106 |
-
letter-spacing: normal;
|
| 107 |
-
text-transform: none;
|
| 108 |
-
display: inline-block;
|
| 109 |
-
white-space: nowrap;
|
| 110 |
-
word-wrap: normal;
|
| 111 |
-
direction: ltr;
|
| 112 |
-
-webkit-font-feature-settings: 'liga';
|
| 113 |
-
-webkit-font-smoothing: antialiased;
|
| 114 |
-
}
|
| 115 |
-
.btn {
|
| 116 |
-
--bs-btn-padding-x: 0.75rem;
|
| 117 |
-
--bs-btn-padding-y: 0.375rem;
|
| 118 |
-
--bs-btn-font-family: ;
|
| 119 |
-
--bs-btn-font-size: 1rem;
|
| 120 |
-
--bs-btn-font-weight: 400;
|
| 121 |
-
--bs-btn-line-height: 1.5;
|
| 122 |
-
--bs-btn-color: #212529;
|
| 123 |
-
--bs-btn-bg: transparent;
|
| 124 |
-
--bs-btn-border-width: 1px;
|
| 125 |
-
--bs-btn-border-color: transparent;
|
| 126 |
-
--bs-btn-border-radius: 0.375rem;
|
| 127 |
-
--bs-btn-hover-border-color: transparent;
|
| 128 |
-
--bs-btn-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15),0 1px 1px rgba(0, 0, 0, 0.075);
|
| 129 |
-
--bs-btn-disabled-opacity: 0.65;
|
| 130 |
-
--bs-btn-focus-box-shadow: 0 0 0 0.25rem rgba(var(--bs-btn-focus-shadow-rgb), .5);
|
| 131 |
-
display: inline-block;
|
| 132 |
-
padding: var(--bs-btn-padding-y) var(--bs-btn-padding-x);
|
| 133 |
-
font-family: var(--bs-btn-font-family);
|
| 134 |
-
font-size: var(--bs-btn-font-size);
|
| 135 |
-
font-weight: var(--bs-btn-font-weight);
|
| 136 |
-
line-height: var(--bs-btn-line-height);
|
| 137 |
-
color: var(--bs-btn-color);
|
| 138 |
-
text-align: center;
|
| 139 |
-
text-decoration: none;
|
| 140 |
-
vertical-align: middle;
|
| 141 |
-
cursor: pointer;
|
| 142 |
-
-webkit-user-select: none;
|
| 143 |
-
-moz-user-select: none;
|
| 144 |
-
user-select: none;
|
| 145 |
-
border: var(--bs-btn-border-width) solid var(--bs-btn-border-color);
|
| 146 |
-
border-radius: var(--bs-btn-border-radius);
|
| 147 |
-
background-color: var(--bs-btn-bg);
|
| 148 |
-
transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
|
| 149 |
-
display:flex;
|
| 150 |
-
}
|
| 151 |
-
#feed-profile-tab{
|
| 152 |
-
display:flex;
|
| 153 |
-
align-items:center;
|
| 154 |
-
}
|
| 155 |
-
.feed-tab-header{
|
| 156 |
-
border-bottom:1px solid var(--border-color-primary)
|
| 157 |
-
}
|
| 158 |
-
.feed-tab-default {
|
| 159 |
-
width:100%;
|
| 160 |
-
margin-bottom: -1px;
|
| 161 |
-
border: 1px solid transparent;
|
| 162 |
-
border-color: transparent;
|
| 163 |
-
border-bottom: none;
|
| 164 |
-
border-top-right-radius: var(--container-radius) !important;
|
| 165 |
-
border-top-left-radius: var(--container-radius) !important;
|
| 166 |
-
padding: var(--size-1) var(--size-4) !important;
|
| 167 |
-
color: var(--body-text-color-subdued) !important;
|
| 168 |
-
font-weight: var(--section-header-text-weight) !important;
|
| 169 |
-
font-size: var(--section-header-text-size) !important;
|
| 170 |
-
}
|
| 171 |
-
.selected.feed-tab-default {
|
| 172 |
-
border-color: var(--border-color-primary);
|
| 173 |
-
background: var(--background-fill-primary);
|
| 174 |
-
color: var(--body-text-color) !important;
|
| 175 |
-
font-weight:700;
|
| 176 |
-
border-bottom:1px solid white;
|
| 177 |
-
}
|
| 178 |
-
.feed-tab-class{
|
| 179 |
-
display:flex;
|
| 180 |
-
justify-content:space-between;
|
| 181 |
-
width:70%;
|
| 182 |
-
}
|
| 183 |
-
.feed-tab-class-search{
|
| 184 |
-
display:flex;
|
| 185 |
-
align-items: center;
|
| 186 |
-
}
|
| 187 |
-
|
| 188 |
-
#best-product-tab{
|
| 189 |
-
background: var(--panel-background-fill);
|
| 190 |
-
}
|
| 191 |
-
.potd{
|
| 192 |
-
font-weight: var(--section-header-text-weight);
|
| 193 |
-
font-size: var(--section-header-text-size);
|
| 194 |
-
margin-bottom:5px;
|
| 195 |
-
}
|
| 196 |
-
|
| 197 |
-
.pinterest-gallery {
|
| 198 |
-
display: flex;
|
| 199 |
-
flex-wrap: wrap;
|
| 200 |
-
justify-content: space-between;
|
| 201 |
-
margin: 0 auto;
|
| 202 |
-
max-width: 1600px;
|
| 203 |
-
padding: 0 8px;
|
| 204 |
-
}
|
| 205 |
-
|
| 206 |
-
.pinterest-column-gallery {
|
| 207 |
-
flex-wrap: wrap;
|
| 208 |
-
margin: 0 auto;
|
| 209 |
-
max-width: 1600px;
|
| 210 |
-
padding: 0 8px;
|
| 211 |
-
}
|
| 212 |
-
|
| 213 |
-
.pinterest-item {
|
| 214 |
-
width: calc(25% - 3px);
|
| 215 |
-
margin-bottom: 20px;
|
| 216 |
-
box-sizing: border-box;
|
| 217 |
-
position: relative;
|
| 218 |
-
}
|
| 219 |
-
@media screen and (max-width: 1380px){
|
| 220 |
-
.pinterest-item{
|
| 221 |
-
width: calc(50% - 3px) !important;
|
| 222 |
-
}
|
| 223 |
-
}
|
| 224 |
-
.pinterest-column-item{
|
| 225 |
-
width:100%;
|
| 226 |
-
margin-bottom: 4px;
|
| 227 |
-
box-sizing: border-box;
|
| 228 |
-
position: relative;
|
| 229 |
-
}
|
| 230 |
-
.pinterest-column-item img {
|
| 231 |
-
width: 100%;
|
| 232 |
-
height: auto;
|
| 233 |
-
display: block;
|
| 234 |
-
}
|
| 235 |
-
.pinterest-item img {
|
| 236 |
-
width: 100%;
|
| 237 |
-
height: auto;
|
| 238 |
-
display: block;
|
| 239 |
-
cursor: pointer;
|
| 240 |
-
pointer-events: auto;
|
| 241 |
-
}
|
| 242 |
-
.item-overlay {
|
| 243 |
-
position: absolute;
|
| 244 |
-
top: 0;
|
| 245 |
-
left: 0;
|
| 246 |
-
width: 100%;
|
| 247 |
-
height: 32px;
|
| 248 |
-
opacity: 0.8;
|
| 249 |
-
background-color: rgba(0, 0, 0, 0.7);
|
| 250 |
-
display:flex;
|
| 251 |
-
align-items:center;
|
| 252 |
-
justify-content: space-between;
|
| 253 |
-
}
|
| 254 |
-
|
| 255 |
-
.item-overlay p {
|
| 256 |
-
color: #FFFFFF !important;
|
| 257 |
-
right: 5px;
|
| 258 |
-
top:5px;
|
| 259 |
-
position: absolute;
|
| 260 |
-
font-size: var(--text-md);
|
| 261 |
-
font-weight: var(--body-text-weight);
|
| 262 |
-
text-overflow: ellipsis;
|
| 263 |
-
overflow: hidden;
|
| 264 |
-
white-space: nowrap;
|
| 265 |
-
max-width:60%;
|
| 266 |
-
}
|
| 267 |
-
.liked-button-div{
|
| 268 |
-
color: #FFFFFF !important;
|
| 269 |
-
font-size: var(--text-md);
|
| 270 |
-
font-weight: var(--body-text-weight);
|
| 271 |
-
left: 5px;
|
| 272 |
-
top:5px;
|
| 273 |
-
display: flex;
|
| 274 |
-
flex-direction: row;
|
| 275 |
-
align-items: center;
|
| 276 |
-
padding: 2px 3px;
|
| 277 |
-
gap: 4px;
|
| 278 |
-
min-width: 42px;
|
| 279 |
-
max-width:62px;
|
| 280 |
-
height: 20px;
|
| 281 |
-
border-radius: 2px;
|
| 282 |
-
margin-left:5px;
|
| 283 |
-
}
|
| 284 |
-
.liked-button-div button{
|
| 285 |
-
color: #FFFFFF !important;
|
| 286 |
-
}
|
| 287 |
-
.already-liked-div{
|
| 288 |
-
background: linear-gradient(180deg, #3041E0 0%, #9330E0 100%);
|
| 289 |
-
}
|
| 290 |
-
.not-liked-div{
|
| 291 |
-
background: #4B5057
|
| 292 |
-
}
|
| 293 |
-
#prompt-input{
|
| 294 |
-
border: 1px solid #ccc;
|
| 295 |
-
border-radius: 5px;
|
| 296 |
-
transition: border-color 0.2s ease-in-out;
|
| 297 |
-
color: var(--body-text-color) !important;
|
| 298 |
-
background: var(--input-background-fill);
|
| 299 |
-
}
|
| 300 |
-
#prompt-input:focus {
|
| 301 |
-
border-color: skyblue;
|
| 302 |
-
outline: none;
|
| 303 |
-
}
|
| 304 |
-
.btn-write-row{
|
| 305 |
-
box-sizing: border-box;
|
| 306 |
-
|
| 307 |
-
/* Auto layout */
|
| 308 |
-
|
| 309 |
-
display: flex;
|
| 310 |
-
flex-direction: column;
|
| 311 |
-
align-items: center;
|
| 312 |
-
padding: 0px;
|
| 313 |
-
gap: 12px;
|
| 314 |
-
border-radius: 5px;
|
| 315 |
-
|
| 316 |
-
/* Inside auto layout */
|
| 317 |
-
|
| 318 |
-
flex: none;
|
| 319 |
-
order: 0;
|
| 320 |
-
flex-grow: 0;
|
| 321 |
-
font-size: 14px;
|
| 322 |
-
|
| 323 |
-
}
|
| 324 |
-
.btn-cancel{
|
| 325 |
-
|
| 326 |
-
width: 66px;
|
| 327 |
-
height: 30px;
|
| 328 |
-
border: 1px solid white !important;
|
| 329 |
-
line-height: 17px !important;
|
| 330 |
-
text-align: center !important;
|
| 331 |
-
color: #FFFFFF !important;
|
| 332 |
-
align-items: center !important;
|
| 333 |
-
justify-content: center !important;
|
| 334 |
-
margin-right:10px !important;
|
| 335 |
-
}
|
| 336 |
-
.btn-save{
|
| 337 |
-
color: #4B5057 !important;
|
| 338 |
-
background: #888D96 !important;
|
| 339 |
-
width: 85px !important;
|
| 340 |
-
height: 30px !important;
|
| 341 |
-
align-items: center !important;
|
| 342 |
-
justify-content: center !important;
|
| 343 |
-
}
|
| 344 |
-
.promptModal{
|
| 345 |
-
position: fixed;
|
| 346 |
-
z-index: 999;
|
| 347 |
-
left: 0;
|
| 348 |
-
top: 0;
|
| 349 |
-
width: 100%;
|
| 350 |
-
height: 100%;
|
| 351 |
-
overflow: auto;
|
| 352 |
-
background: var(--input-background-fill);
|
| 353 |
-
overflow:scroll;
|
| 354 |
-
}
|
| 355 |
-
.prompt-modal-page{
|
| 356 |
-
display:flex;
|
| 357 |
-
justify-content: center;
|
| 358 |
-
flex-wrap: wrap;
|
| 359 |
-
}
|
| 360 |
-
.prompt-modal-image{
|
| 361 |
-
max-width: calc(100% - 400px);
|
| 362 |
-
margin: auto;
|
| 363 |
-
flex-basis: 100%;
|
| 364 |
-
background-size: cover;
|
| 365 |
-
background-position: center;
|
| 366 |
-
display:flex;
|
| 367 |
-
height:100vh;
|
| 368 |
-
justify-content: center;
|
| 369 |
-
align-items:center;
|
| 370 |
-
margin-top:0px;
|
| 371 |
-
}
|
| 372 |
-
.prompt-modal-image img{
|
| 373 |
-
max-width:720px;
|
| 374 |
-
max-height:100vh;
|
| 375 |
-
}
|
| 376 |
-
@media screen and (max-width: 420px) {
|
| 377 |
-
.prompt-modal-image{
|
| 378 |
-
margin-bottom: 0px;
|
| 379 |
-
height:100%;
|
| 380 |
-
max-width:100%;
|
| 381 |
-
|
| 382 |
-
}
|
| 383 |
-
.prompt-modal-image img{
|
| 384 |
-
height:60vh;
|
| 385 |
-
}
|
| 386 |
-
.prompt-modal-image img{
|
| 387 |
-
max-width:320px;
|
| 388 |
-
}
|
| 389 |
-
}
|
| 390 |
-
.prompt-modal-sidebar{
|
| 391 |
-
max-width:400px;
|
| 392 |
-
flex-basis: 100%;
|
| 393 |
-
background-color: rgba(47, 49, 50, 0.8);
|
| 394 |
-
color: white;
|
| 395 |
-
}
|
| 396 |
-
.modal-sidebar-header{
|
| 397 |
-
display: flex;
|
| 398 |
-
align-items: center;
|
| 399 |
-
justify-content: space-between;
|
| 400 |
-
color:white;
|
| 401 |
-
font-weight: 400;
|
| 402 |
-
font-size: 24.3293px;
|
| 403 |
-
padding-top:12px;
|
| 404 |
-
padding-bottom:12px;
|
| 405 |
-
border: 1px solid #AFB6BD;
|
| 406 |
-
}
|
| 407 |
-
.modal-like-wrapper{
|
| 408 |
-
min-width:70px;
|
| 409 |
-
max-width:100px;
|
| 410 |
-
display:flex;
|
| 411 |
-
align-items: center;
|
| 412 |
-
justify-content: center;
|
| 413 |
-
}
|
| 414 |
-
.modal-writer{
|
| 415 |
-
font-family: 'Inter';
|
| 416 |
-
font-style: normal;
|
| 417 |
-
font-weight: 700 !important;
|
| 418 |
-
font-size: 14px !important;
|
| 419 |
-
/* identical to box height */
|
| 420 |
-
color: #FFFFFF !important;
|
| 421 |
-
}
|
| 422 |
-
.modal-writer-time{
|
| 423 |
-
font-weight: 300 !important;
|
| 424 |
-
font-size: 14px !important;
|
| 425 |
-
/* identical to box height */
|
| 426 |
-
text-align: right;
|
| 427 |
-
color: #FFFFFF !important;
|
| 428 |
-
}
|
| 429 |
-
.modal-writer-type{
|
| 430 |
-
color: white !important;
|
| 431 |
-
border: 1px solid white;
|
| 432 |
-
border-radius: 5px !important;
|
| 433 |
-
background-color: #AFB6BD !important;
|
| 434 |
-
resize: none !important;
|
| 435 |
-
overflow: hidden !important;
|
| 436 |
-
padding: 10px !important;
|
| 437 |
-
width: 95% !important;
|
| 438 |
-
min-height: 39.35px !important;
|
| 439 |
-
transition: height 0.3s ease-in-out !important;
|
| 440 |
-
margin: 10px !important;
|
| 441 |
-
}
|
| 442 |
-
.profile-writer-type{
|
| 443 |
-
border: 1px solid white;
|
| 444 |
-
border-radius: 5px !important;
|
| 445 |
-
resize: none !important;
|
| 446 |
-
overflow: hidden !important;
|
| 447 |
-
padding: 10px !important;
|
| 448 |
-
width: 95% !important;
|
| 449 |
-
min-height: 39.35px !important;
|
| 450 |
-
transition: height 0.3s ease-in-out !important;
|
| 451 |
-
margin: 10px !important;
|
| 452 |
-
}
|
| 453 |
-
.write-row-button{
|
| 454 |
-
display:flex;
|
| 455 |
-
justify-content: flex-end;
|
| 456 |
-
width: 95%;
|
| 457 |
-
}
|
| 458 |
-
.big-liked-button-div button{
|
| 459 |
-
height: 38.73px;
|
| 460 |
-
color: #FFFFFF !important;
|
| 461 |
-
left: 5px;
|
| 462 |
-
top:5px;
|
| 463 |
-
display: flex;
|
| 464 |
-
flex-direction: row;
|
| 465 |
-
align-items: center;
|
| 466 |
-
padding: 2px 3px;
|
| 467 |
-
gap: 4px;
|
| 468 |
-
width:100%;
|
| 469 |
-
border-radius: 4.86585px;
|
| 470 |
-
}
|
| 471 |
-
.modal-writer-wrapper-exit{
|
| 472 |
-
margin-right:10px !important;
|
| 473 |
-
}
|
| 474 |
-
.prompt-modal-content {
|
| 475 |
-
background-color: white;
|
| 476 |
-
margin: 15% auto;
|
| 477 |
-
padding: 20px;
|
| 478 |
-
border-radius: 5px;
|
| 479 |
-
width: 50%;
|
| 480 |
-
text-align: center;
|
| 481 |
-
position: relative; /* Add position relative */
|
| 482 |
-
color: black;
|
| 483 |
-
}
|
| 484 |
-
.prompt-modal-close{
|
| 485 |
-
font-size:50px;
|
| 486 |
-
color: black !important;
|
| 487 |
-
}
|
| 488 |
-
.prompt-modal-table{
|
| 489 |
-
margin-top: 20px;
|
| 490 |
-
width: 100%;
|
| 491 |
-
border-collapse: collapse;
|
| 492 |
-
text-align: left;
|
| 493 |
-
}
|
| 494 |
-
|
| 495 |
-
.prompt-modal-table td, .prompt-modal-table th {
|
| 496 |
-
padding: 5px;
|
| 497 |
-
border: 1px solid #ccc;
|
| 498 |
-
color: black !important;
|
| 499 |
-
}
|
| 500 |
-
.prompt-send-to{
|
| 501 |
-
display:flex;
|
| 502 |
-
justify-content: center;
|
| 503 |
-
margin-top:10px;
|
| 504 |
-
}
|
| 505 |
-
.btn-send-to {
|
| 506 |
-
color: white !important;
|
| 507 |
-
padding: 14px 20px !important;
|
| 508 |
-
border: none !important;
|
| 509 |
-
cursor: pointer !important;
|
| 510 |
-
margin-bottom:0px !important;
|
| 511 |
-
border: 1px solid #AFB6BD !important;
|
| 512 |
-
border-radius: 5px !important;
|
| 513 |
-
}
|
| 514 |
-
|
| 515 |
-
.btn-send-to-img {
|
| 516 |
-
right: 20px;
|
| 517 |
-
margin-right: 20px !important;
|
| 518 |
-
}
|
| 519 |
-
|
| 520 |
-
.btn-send-to-text {
|
| 521 |
-
margin-right:10px !important;
|
| 522 |
-
}
|
| 523 |
-
.toggle-btn {
|
| 524 |
-
display: inline-block;
|
| 525 |
-
position: relative;
|
| 526 |
-
width: 50px;
|
| 527 |
-
height: 24px;
|
| 528 |
-
}
|
| 529 |
-
.tag-button-selected{
|
| 530 |
-
background-color: #131313 !important;
|
| 531 |
-
color: #FFFFFF !important;
|
| 532 |
-
}
|
| 533 |
-
.tag-button-unselected{
|
| 534 |
-
color: #888D96 !important;
|
| 535 |
-
background-color:#4B5057 !important;
|
| 536 |
-
}
|
| 537 |
-
.tag-button{
|
| 538 |
-
display: inline-block;
|
| 539 |
-
border: none;
|
| 540 |
-
padding: 4px 32px !important;
|
| 541 |
-
text-align: center !important;
|
| 542 |
-
text-decoration: none !important;
|
| 543 |
-
display: inline-block !important;
|
| 544 |
-
font-size: 16px !important;
|
| 545 |
-
border-radius: 4px !important;
|
| 546 |
-
transition-duration: 0.4s;
|
| 547 |
-
cursor: pointer;
|
| 548 |
-
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2) !important;
|
| 549 |
-
}
|
| 550 |
-
.toggle-letter {
|
| 551 |
-
display: inline-block;
|
| 552 |
-
position: absolute;
|
| 553 |
-
top: 0;
|
| 554 |
-
left: -80px;
|
| 555 |
-
width: 80px;
|
| 556 |
-
height: 24px;
|
| 557 |
-
line-height: 24px;
|
| 558 |
-
text-align: center;
|
| 559 |
-
font-weight: bold;
|
| 560 |
-
font-size: 14px;
|
| 561 |
-
color: #333;
|
| 562 |
-
}
|
| 563 |
-
|
| 564 |
-
.toggle-btn input[type="checkbox"] {
|
| 565 |
-
opacity: 0;
|
| 566 |
-
width: 0;
|
| 567 |
-
height: 0;
|
| 568 |
-
}
|
| 569 |
-
.slider {
|
| 570 |
-
position: absolute;
|
| 571 |
-
cursor: pointer;
|
| 572 |
-
top: 0;
|
| 573 |
-
left: 0;
|
| 574 |
-
right: 0;
|
| 575 |
-
bottom: 0;
|
| 576 |
-
background-color: #ccc;
|
| 577 |
-
border-radius: 24px;
|
| 578 |
-
transition: .4s;
|
| 579 |
-
}
|
| 580 |
-
.slider,.slider:before {
|
| 581 |
-
position: absolute;
|
| 582 |
-
transition: .4s
|
| 583 |
-
}
|
| 584 |
-
.slider:before {
|
| 585 |
-
position: absolute;
|
| 586 |
-
content: "";
|
| 587 |
-
height: 16px;
|
| 588 |
-
width: 16px;
|
| 589 |
-
left: 4px;
|
| 590 |
-
bottom: 4px;
|
| 591 |
-
background-color: white;
|
| 592 |
-
border-radius: 50%;
|
| 593 |
-
transition: .4s;
|
| 594 |
-
}
|
| 595 |
-
|
| 596 |
-
input:checked + .slider {
|
| 597 |
-
background-color: green;
|
| 598 |
-
}
|
| 599 |
-
input:checked + .slider:before {
|
| 600 |
-
transform: translateX(26px);
|
| 601 |
-
}
|
| 602 |
-
.slider.round {
|
| 603 |
-
border-radius: 24px;
|
| 604 |
-
}
|
| 605 |
-
|
| 606 |
-
.slider.round:before {
|
| 607 |
-
border-radius: 50%;
|
| 608 |
-
}
|
| 609 |
-
.redline-text {
|
| 610 |
-
border-bottom: 1px solid red;
|
| 611 |
-
}
|
| 612 |
-
.redline-overlay {
|
| 613 |
-
position: absolute;
|
| 614 |
-
bottom: 0;
|
| 615 |
-
left: 0;
|
| 616 |
-
width: 100%;
|
| 617 |
-
height: 83px;
|
| 618 |
-
pointer-events: none;
|
| 619 |
-
}
|
| 620 |
-
.redline-section {
|
| 621 |
-
position: absolute;
|
| 622 |
-
bottom: 0;
|
| 623 |
-
height: 2px;
|
| 624 |
-
background-color: red;
|
| 625 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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