Spaces:
Sleeping
Sleeping
EC2 Default User
commited on
Commit
·
6f19838
1
Parent(s):
2bad8ca
Initial
Browse files- .gitignore +18 -0
- Dockerfile +28 -0
- README.md +29 -4
- main.py +52 -0
- requirements.txt +4 -0
- web-build/asset-manifest.json +20 -0
- web-build/favicon-16.png +0 -0
- web-build/favicon-32.png +0 -0
- web-build/favicon.ico +0 -0
- web-build/index.html +1 -0
- web-build/manifest.json +8 -0
- web-build/pwa/apple-touch-icon/apple-touch-icon-180.png +0 -0
- web-build/serve.json +13 -0
- web-build/static/js/37.47643d52.js +0 -0
- web-build/static/js/37.47643d52.js.LICENSE.txt +54 -0
- web-build/static/js/37.47643d52.js.map +0 -0
- web-build/static/js/main.8ba1c129.js +2 -0
- web-build/static/js/main.8ba1c129.js.map +1 -0
- web-build/static/media/Sigmar-Regular.daeeaca2f7490cb1c50c.ttf +0 -0
- web-build/static/media/avocado.667d95040b7743f10475.jpg +0 -0
.gitignore
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
node_modules/
|
2 |
+
.expo/
|
3 |
+
dist/
|
4 |
+
venv/
|
5 |
+
npm-debug.*
|
6 |
+
*.jks
|
7 |
+
*.p8
|
8 |
+
*.p12
|
9 |
+
*.key
|
10 |
+
*.mobileprovision
|
11 |
+
*.orig.*
|
12 |
+
|
13 |
+
|
14 |
+
# macOS
|
15 |
+
.DS_Store
|
16 |
+
|
17 |
+
# Temporary files created by Metro to check the health of the file watcher
|
18 |
+
.metro-health-check*
|
Dockerfile
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use the official lightweight Python image.
|
2 |
+
FROM python:3.10-slim
|
3 |
+
|
4 |
+
# Copy local code to the container image.
|
5 |
+
WORKDIR /app
|
6 |
+
COPY . ./
|
7 |
+
|
8 |
+
# Install production dependencies.
|
9 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
10 |
+
|
11 |
+
# Set up a new user named "user" with user ID 1000
|
12 |
+
RUN useradd -m -u 1000 user
|
13 |
+
|
14 |
+
# Switch to the "user" user
|
15 |
+
USER user
|
16 |
+
|
17 |
+
# Set home to the user's home directory
|
18 |
+
ENV HOME=/home/user \
|
19 |
+
PATH=/home/user/.local/bin:$PATH
|
20 |
+
|
21 |
+
# Set the working directory to the user's home directory
|
22 |
+
WORKDIR $HOME/app
|
23 |
+
|
24 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
25 |
+
COPY --chown=user . $HOME/app
|
26 |
+
|
27 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
28 |
+
|
README.md
CHANGED
@@ -1,11 +1,36 @@
|
|
1 |
---
|
2 |
title: React Native Serve Ml
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: docker
|
|
|
7 |
pinned: false
|
8 |
license: mit
|
9 |
---
|
10 |
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
---
|
2 |
title: React Native Serve Ml
|
3 |
+
emoji: 🔥
|
4 |
+
colorFrom: red
|
5 |
+
colorTo: blue
|
6 |
sdk: docker
|
7 |
+
port: 8000
|
8 |
pinned: false
|
9 |
license: mit
|
10 |
---
|
11 |
|
12 |
+
|
13 |
+
# React Native App with Expo
|
14 |
+
|
15 |
+
This repository contains a static React Native application built using Expo with FastApi and Docker for deployment. It's a single container that's running [here](https://huggingface.co/spaces/Hatman/react-native-serve-ml). It's serving several diffusion models that use the huggingface [inference-api](https://huggingface.co/docs/api-inference/index). The code uses baseline components to demonstrate deployment techniques for ML endpoints. The root repository and alternative deployments are [here](https://github.com/HatmanStack/react-native-serve-ml).
|
16 |
+
|
17 |
+
## Installation
|
18 |
+
|
19 |
+
To generate the static content for this container have a working Node/npm installation then and clone this [github repo](https://github.com/HatmanStack/react-native-serve-ml). In `App.js` change the `axios.post` call to `"/api"`.
|
20 |
+
|
21 |
+
```shell
|
22 |
+
npm install -g yarn
|
23 |
+
yarn
|
24 |
+
npx expo export:web
|
25 |
+
```
|
26 |
+
|
27 |
+
Static files are output to the web-build folder in the root directory. Replace the web-build folder in the Huggingface-Space directory with the web-build folder in the root directory. Once that's done, the static content of the app will be updated. The Huggingface-Space directory can be deployed as a single container.<b>In a single container to reach the endpoint from the axios call use "/api" not "http://localhost:8081/api".</b>
|
28 |
+
|
29 |
+
## License
|
30 |
+
|
31 |
+
This project is licensed under the [MIT License](LICENSE)
|
32 |
+
|
33 |
+
## Acknowledgments
|
34 |
+
|
35 |
+
- This application is built with Expo, a powerful framework for building cross-platform mobile applications. Learn more about Expo: [https://expo.io](https://expo.io)
|
36 |
+
|
main.py
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fastapi import FastAPI
|
2 |
+
from fastapi.staticfiles import StaticFiles
|
3 |
+
from fastapi.responses import FileResponse
|
4 |
+
import json
|
5 |
+
import requests
|
6 |
+
import base64
|
7 |
+
from pydantic import BaseModel
|
8 |
+
from PIL import Image
|
9 |
+
from io import BytesIO
|
10 |
+
|
11 |
+
app = FastAPI()
|
12 |
+
|
13 |
+
class Item(BaseModel):
|
14 |
+
prompt: str
|
15 |
+
steps: int
|
16 |
+
guidance: float
|
17 |
+
modelID: str
|
18 |
+
|
19 |
+
@app.post("/api")
|
20 |
+
async def inference(item: Item):
|
21 |
+
print("check")
|
22 |
+
if "dallinmackay" in item.modelID:
|
23 |
+
prompt = "lvngvncnt, " + item.prompt
|
24 |
+
if "nousr" in item.modelID:
|
25 |
+
prompt = "nousr robot, " + item.prompt
|
26 |
+
if "nitrosocke" in item.modelID:
|
27 |
+
prompt = "arcane, " + item.prompt
|
28 |
+
if "dreamlike" in item.modelID:
|
29 |
+
prompt = "photo, " + item.prompt
|
30 |
+
if "prompthero" in item.modelID:
|
31 |
+
prompt = "mdjrny-v4 style, " + item.prompt
|
32 |
+
data = {"inputs":prompt, "options":{"wait_for_model": True, "use_cache": False}}
|
33 |
+
API_URL = "https://api-inference.huggingface.co/models/" + item.modelID
|
34 |
+
|
35 |
+
headers = {"Authorization": f"Bearer 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"}
|
36 |
+
api_data = json.dumps(data)
|
37 |
+
response = requests.request("POST", API_URL, headers=headers, data=api_data)
|
38 |
+
|
39 |
+
image_stream = BytesIO(response.content)
|
40 |
+
image = Image.open(image_stream)
|
41 |
+
image.save("response.png")
|
42 |
+
with open('response.png', 'rb') as f:
|
43 |
+
base64image = base64.b64encode(f.read())
|
44 |
+
|
45 |
+
return {"output": base64image}
|
46 |
+
|
47 |
+
app.mount("/", StaticFiles(directory="web-build", html=True), name="build")
|
48 |
+
|
49 |
+
@app.get('/')
|
50 |
+
def homepage() -> FileResponse:
|
51 |
+
return FileResponse(path="/app/build/index.html", media_type="text/html")
|
52 |
+
|
requirements.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Pillow
|
2 |
+
requests
|
3 |
+
uvicorn
|
4 |
+
fastapi
|
web-build/asset-manifest.json
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"files": {
|
3 |
+
"main.js": "/static/js/main.8ba1c129.js",
|
4 |
+
"static/js/37.47643d52.js": "/static/js/37.47643d52.js",
|
5 |
+
"static/media/Sigmar-Regular.ttf": "/static/media/Sigmar-Regular.daeeaca2f7490cb1c50c.ttf",
|
6 |
+
"static/media/avocado.jpg": "/static/media/avocado.667d95040b7743f10475.jpg",
|
7 |
+
"favicon.ico": "/favicon.ico",
|
8 |
+
"favicon-32.png": "/favicon-32.png",
|
9 |
+
"index.html": "/index.html",
|
10 |
+
"favicon-16.png": "/favicon-16.png",
|
11 |
+
"serve.json": "/serve.json",
|
12 |
+
"manifest.json": "/manifest.json",
|
13 |
+
"main.8ba1c129.js.map": "/static/js/main.8ba1c129.js.map",
|
14 |
+
"37.47643d52.js.map": "/static/js/37.47643d52.js.map"
|
15 |
+
},
|
16 |
+
"entrypoints": [
|
17 |
+
"static/js/37.47643d52.js",
|
18 |
+
"static/js/main.8ba1c129.js"
|
19 |
+
]
|
20 |
+
}
|
web-build/favicon-16.png
ADDED
![]() |
web-build/favicon-32.png
ADDED
![]() |
web-build/favicon.ico
ADDED
|
web-build/index.html
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta httpequiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1.00001,viewport-fit=cover"/><title>serve-ml</title><style>#root,body,html{width:100%;-webkit-overflow-scrolling:touch;margin:0;padding:0;min-height:100%}#root{flex-shrink:0;flex-basis:auto;flex-grow:1;display:flex;flex:1}html{scroll-behavior:smooth;-webkit-text-size-adjust:100%;height:calc(100% + env(safe-area-inset-top))}body{display:flex;overflow-y:auto;overscroll-behavior-y:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-ms-overflow-style:scrollbar}</style><link rel="manifest" href="/manifest.json"><link rel="icon" type="image/png" sizes="16x16" href="/favicon-16.png"><link rel="icon" type="image/png" sizes="32x32" href="/favicon-32.png"><link rel="shortcut icon" href="/favicon.ico"><meta name="mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-touch-fullscreen" content="yes"><meta name="apple-mobile-web-app-title" content="serve-ml"><meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"><link rel="apple-touch-icon" sizes="180x180" href="/pwa/apple-touch-icon/apple-touch-icon-180.png"><script defer="defer" src="/static/js/37.47643d52.js"></script><script defer="defer" src="/static/js/main.8ba1c129.js"></script></head><body><noscript><form action="" style="background-color:#fff;position:fixed;top:0;left:0;right:0;bottom:0;z-index:9999"><div style="font-size:18px;font-family:Helvetica,sans-serif;line-height:24px;margin:10%;width:80%"><p>Oh no! It looks like JavaScript is not enabled in your browser.</p><p style="margin:20px 0"><button type="submit" style="background-color:#4630eb;border-radius:100px;border:none;box-shadow:none;color:#fff;cursor:pointer;font-weight:700;line-height:20px;padding:6px 16px">Reload</button></p></div></form></noscript><div id="root"></div></body></html>
|
web-build/manifest.json
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"display": "standalone",
|
3 |
+
"lang": "en",
|
4 |
+
"name": "serve-ml",
|
5 |
+
"short_name": "serve-ml",
|
6 |
+
"start_url": "/?utm_source=web_app_manifest",
|
7 |
+
"orientation": "portrait"
|
8 |
+
}
|
web-build/pwa/apple-touch-icon/apple-touch-icon-180.png
ADDED
![]() |
web-build/serve.json
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"headers": [
|
3 |
+
{
|
4 |
+
"source": "static/**/*.js",
|
5 |
+
"headers": [
|
6 |
+
{
|
7 |
+
"key": "Cache-Control",
|
8 |
+
"value": "public, max-age=31536000, immutable"
|
9 |
+
}
|
10 |
+
]
|
11 |
+
}
|
12 |
+
]
|
13 |
+
}
|
web-build/static/js/37.47643d52.js
ADDED
The diff for this file is too large to render.
See raw diff
|
|
web-build/static/js/37.47643d52.js.LICENSE.txt
ADDED
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*
|
2 |
+
object-assign
|
3 |
+
(c) Sindre Sorhus
|
4 |
+
@license MIT
|
5 |
+
*/
|
6 |
+
|
7 |
+
/**
|
8 |
+
* @license
|
9 |
+
* Lodash <https://lodash.com/>
|
10 |
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
11 |
+
* Released under MIT license <https://lodash.com/license>
|
12 |
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
13 |
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
14 |
+
*/
|
15 |
+
|
16 |
+
/**
|
17 |
+
* @license React
|
18 |
+
* react-dom.production.min.js
|
19 |
+
*
|
20 |
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
21 |
+
*
|
22 |
+
* This source code is licensed under the MIT license found in the
|
23 |
+
* LICENSE file in the root directory of this source tree.
|
24 |
+
*/
|
25 |
+
|
26 |
+
/**
|
27 |
+
* @license React
|
28 |
+
* react-jsx-runtime.production.min.js
|
29 |
+
*
|
30 |
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
31 |
+
*
|
32 |
+
* This source code is licensed under the MIT license found in the
|
33 |
+
* LICENSE file in the root directory of this source tree.
|
34 |
+
*/
|
35 |
+
|
36 |
+
/**
|
37 |
+
* @license React
|
38 |
+
* react.production.min.js
|
39 |
+
*
|
40 |
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
41 |
+
*
|
42 |
+
* This source code is licensed under the MIT license found in the
|
43 |
+
* LICENSE file in the root directory of this source tree.
|
44 |
+
*/
|
45 |
+
|
46 |
+
/**
|
47 |
+
* @license React
|
48 |
+
* scheduler.production.min.js
|
49 |
+
*
|
50 |
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
51 |
+
*
|
52 |
+
* This source code is licensed under the MIT license found in the
|
53 |
+
* LICENSE file in the root directory of this source tree.
|
54 |
+
*/
|
web-build/static/js/37.47643d52.js.map
ADDED
The diff for this file is too large to render.
See raw diff
|
|
web-build/static/js/main.8ba1c129.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
(()=>{"use strict";var e={9215:(e,t,r)=>{r.r(t),r.d(t,{default:()=>B});var a=r(885),n=r(3787),l=r(3426),o=r(5004),i=r(229),u=r(6792),d=r(9385),s=r(4999),c=r(1054),f=r(2840),p=r(9555),h=r(3408),m=r(3287),g=r(2629);function x(e){var t=e.PlaceholderImage;return(0,g.jsx)(m.default,{source:t,style:y.imageStyle})}var y=u.default.create({imageStyle:{width:320,height:440,borderRadius:18,marginTop:20,marginBottom:20,alignSelf:"center"}}),j=r(5509),b=r.n(j);function v(e){var t=e.passSteps,r=e.passGuidance,n=o.useState(45),l=(0,a.default)(n,2),i=l[0],u=l[1],s=o.useState(50),f=(0,a.default)(s,2),p=f[0],h=f[1];return(0,g.jsxs)(d.default,{style:S.container,children:[(0,g.jsx)(c.default,{style:S.captionText,children:"Sampling Steps"}),(0,g.jsx)(b(),{style:S.slider,minimumValue:3,maximumValue:50,step:1,value:i,minimumTrackTintColor:"#958DA5",maximumTrackTintColor:"#9DA58D",thumbTintColor:"#6750A4",onValueChange:function(e){u(e),t(e)}}),(0,g.jsx)(c.default,{style:S.sliderValue,children:i}),(0,g.jsx)(c.default,{style:S.captionText,children:"Guidance"}),(0,g.jsx)(b(),{style:S.slider,minimumValue:0,maximumValue:100,step:.1,value:p,minimumTrackTintColor:"#958DA5",maximumTrackTintColor:"#9DA58D",thumbTintColor:"#6750A4",onValueChange:function(e){h(e),r(e)}}),(0,g.jsx)(c.default,{style:S.sliderValue,children:p})]})}var S=u.default.create({container:{alignItems:"center",paddingTop:50},slider:{width:400,height:40},sliderValue:{fontSize:18,color:"#FFFFFF",textAlign:"center",fontFamily:"Sigmar",letterSpacing:3,paddingBottom:30},captionText:{color:"#FFFFFF",fontSize:20,textAlign:"center",fontFamily:"Sigmar",letterSpacing:3}}),F=r(4942),T=r(6591);function O(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?O(Object(r),!0).forEach((function(t){(0,F.default)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):O(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function C(e){var t=e.passPrompt,r=o.useState(""),n=(0,a.default)(r,2),l=n[0],i=n[1],u=(0,p.default)().width,d=w(w({},D.input),{},{width:u>500?500:u-80});return(0,g.jsx)(T.default,{style:d,placeholder:"Avocado Armchair",multiline:!0,onChangeText:function(e){i(e),t(e)},value:l,maxLength:200})}var D=u.default.create({input:{backgroundColor:"#FFFFFF",borderColor:"#B58392",borderWidth:4,borderBottomLeftRadius:4,borderBottomRightRadius:4,borderStartWidth:10,borderEndWidth:10,borderRadius:6,height:80,paddingLeft:10,paddingRight:10,fontSize:20,fontFamily:"Sigmar"}}),A=r(2982),P=r(2445);function k(){var e=(0,o.useRef)((0,A.default)(Array(12)).map((function(){return new P.default.Value(0)}))).current,t=(0,p.default)().width;(0,o.useEffect)((function(){e.map((function(e,t){var r=P.default.timing(e,{toValue:1,duration:2e3,useNativeDriver:!1}),a=P.default.timing(e,{toValue:0,duration:2e3,useNativeDriver:!1}),n=300,l=450,o=600,i=[t*n,t*l,(11-t)*n,t*o,(11-t)*l,t*n,(11-t)*o,t*l,(11-t)*n,(11-t)*l,t*o,(11-t)*o].map((function(e,t){return P.default.sequence([P.default.delay(e),r,a])})),u=P.default.sequence(i);return P.default.loop(u)})).forEach((function(e){e.start()}))}),[e]);var r=e.map((function(e){return e.interpolate({inputRange:[0,1],outputRange:t>1e3?[60,90]:[20,30],extrapolate:"clamp"})})).map((function(e){return{fontSize:e}}));return(0,g.jsx)(d.default,{style:I.containerbreathing,children:(0,g.jsxs)(c.default,{style:I.heading,children:[(0,g.jsx)(P.default.Text,{style:[I.char,r[0]],children:"R"}),(0,g.jsx)(P.default.Text,{style:[I.char,r[1]],children:"E"}),(0,g.jsx)(P.default.Text,{style:[I.char,r[2]],children:"A"}),(0,g.jsx)(P.default.Text,{style:[I.char,r[3]],children:"C"}),(0,g.jsx)(P.default.Text,{style:[I.char,r[4]],children:"T"}),(0,g.jsx)(P.default.Text,{style:[I.char,r[5]],children:"-"}),(0,g.jsx)(P.default.Text,{style:[I.char,r[6]],children:"N"}),(0,g.jsx)(P.default.Text,{style:[I.char,r[7]],children:"A"}),(0,g.jsx)(P.default.Text,{style:[I.char,r[8]],children:"T"}),(0,g.jsx)(P.default.Text,{style:[I.char,r[9]],children:"I"}),(0,g.jsx)(P.default.Text,{style:[I.char,r[10]],children:"V"}),(0,g.jsx)(P.default.Text,{style:[I.char,r[11]],children:"E"})]})})}var I=u.default.create({containerbreathing:{flex:1/8,alignItems:"center",justifyContent:"center"},heading:{fontWeight:"bold",fontWeight:"20",color:"#6750A4",fontFamily:"Sigmar",posistion:"absolute",top:0,left:0},char:{marginHorizontal:15}}),R=r(3131),V=[{label:"Open Journey",value:"prompthero/openjourney"},{label:"Photo",value:"dreamlike-art/dreamlike-photoreal-2.0"},{label:"Arcane",value:"nitrosocke/Arcane-Diffusion"},{label:"Van-Gogh",value:"dallinmackay/Van-Gogh-diffusion"},{label:"Robots",value:"nousr/robo-diffusion"}];function E(e){var t=e.passModelID;return(0,g.jsx)(R.Dropdown,{style:z.dropdown,selectedTextStyle:z.selectedTextStyle,placeholderStyle:z.placeholderStyle,data:V,labelField:"label",valueField:"value",placeholder:"Model ID",onChange:function(e){t(e.value)}})}var z=u.default.create({dropdown:{margin:16,height:50,width:300,borderBottomColor:"#9DA58D",borderBottomWidth:3},placeholderStyle:{fontSize:25,color:"#FFFFFF",textAlign:"center",fontFamily:"Sigmar",letterSpacing:3},selectedTextStyle:{fontSize:20,letterSpacing:3,color:"#FFFFFF",textAlign:"center",fontFamily:"Sigmar"}}),M=r(9615),_=r(8075);function B(){(0,M.useFonts)({Sigmar:r(8038)});var e=(0,o.useState)(_),t=(0,a.default)(e,2),n=t[0],u=t[1],m=(0,o.useState)(45),y=(0,a.default)(m,2),j=y[0],b=y[1],S=(0,o.useState)(45),F=(0,a.default)(S,2),T=F[0],O=F[1],w=(0,o.useState)("prompthero/openjourney"),D=(0,a.default)(w,2),A=D[0],P=D[1],I=(0,o.useState)("Avocado Armchair"),R=(0,a.default)(I,2),V=R[0],z=R[1],B=(0,o.useState)(""),G=(0,a.default)(B,2),N=G[0],L=G[1],H=(0,o.useState)(!1),q=(0,a.default)(H,2),J=q[0],Y=q[1],K=(0,o.useState)(!1),Q=(0,a.default)(K,2),U=Q[0],X=Q[1],Z=(0,o.useState)("Avocado Armchair"),$=(0,a.default)(Z,2),ee=$[0],te=$[1],re=(0,p.default)().width,ae=function(e){z(e)},ne=function(e){b(e)},le=function(e){O(e)},oe=function(e){X(!1),P(e)};return(0,o.useEffect)((function(){""!=N&&(Y(!0),h.default.post("/api",{prompt:V,steps:j,guidance:T,modelID:A}).then((function(e){console.log(e),Y(!1),te(V),u("data:image/png;base64,"+e.data.output)})).catch((function(e){Y(!1),X(!0),console.log(e)})))}),[N]),(0,g.jsxs)(d.default,{style:W.titlecontainer,children:[(0,g.jsx)(k,{}),(0,g.jsx)(s.default,{scrollY:!0,style:W.ScrollView,children:re>1e3?(0,g.jsxs)(d.default,{style:W.rowContainer,children:[(0,g.jsxs)(d.default,{style:W.columnContainer,children:[(0,g.jsx)(d.default,{children:(0,g.jsx)(C,{passPrompt:ae})}),(0,g.jsxs)(d.default,{style:W.rowContainer,children:[(0,g.jsx)(E,{passModelID:oe}),(0,g.jsxs)(d.default,{style:W.columnContainer,children:[J?(0,g.jsx)(i.default,{size:"large",color:"#B58392",style:W.activityIndicator}):(0,g.jsx)(f.default,{onPress:function(){L(V+"-"+j+"-"+T+"-"+A)},style:function(e){return[{backgroundColor:e.pressed?"#9DA58D":"#958DA5"},W.button]},children:function(e){var t=e.pressed;return(0,g.jsx)(c.default,{style:W.promptText,children:t?"INFERRED!":"Inference"})}}),U?(0,g.jsx)(c.default,{style:W.promptText,children:"Model Error!"}):(0,g.jsx)(g.Fragment,{})]})]}),(0,g.jsx)(d.default,{children:(0,g.jsx)(v,{passSteps:ne,passGuidance:le})})]}),(0,g.jsx)(d.default,{style:W.columnContainer,children:(0,g.jsxs)(d.default,{style:W.columnContainer,children:[(0,g.jsx)(x,{PlaceholderImage:n}),(0,g.jsx)(c.default,{style:W.promptText,children:ee})]})})]}):(0,g.jsxs)(d.default,{style:W.columnContainer,children:[(0,g.jsx)(C,{passPrompt:ae}),(0,g.jsx)(E,{passModelID:oe}),J?(0,g.jsx)(i.default,{size:"large",color:"#B58392"}):(0,g.jsx)(f.default,{onPress:function(){L(V+"-"+j+"-"+T+"-"+A)},style:function(e){return[{backgroundColor:e.pressed?"#9DA58D":"#958DA5"},W.button]},children:function(e){var t=e.pressed;return(0,g.jsx)(c.default,{style:W.promptText,children:t?"INFERRED!":"Inference"})}}),U?(0,g.jsx)(c.default,{style:W.promptText,children:"Model Error!"}):(0,g.jsx)(g.Fragment,{}),(0,g.jsx)(v,{passSteps:ne,passGuidance:le}),(0,g.jsx)(x,{PlaceholderImage:n}),(0,g.jsx)(c.default,{style:W.promptText,children:ee})]})}),(0,g.jsx)(l.default,{style:"auto"})]})}var W=u.default.create({canvascontainer:{backgroundColor:"#25292e",position:"fixed",top:0,left:0,right:0,bottom:0,padding:50},titlecontainer:{backgroundColor:"#25292e",position:"fixed",top:0,left:0,right:0,bottom:0,padding:50},rowContainer:{flex:1,backgroundColor:"#25292e",flexDirection:"row",alignItems:"center",marginTop:10,overflow:"auto",padding:20},columnContainer:{flex:1,alignItems:"center",flexDirection:"column"},button:{fontFamily:"Sigmar",paddingHorizontal:32,borderRadius:4,elevation:3},activityIndicator:{marginLeft:50},promptText:{color:"#FFFFFF",fontSize:18,fontWeight:"italic",textAlign:"center",wordWrap:"break-word",fontFamily:"Sigmar",letterSpacing:2,lineHeight:30},ScrollView:{backgroundColor:"#25292e",marginTop:50,padding:5}});(0,n.default)(B)},8038:(e,t,r)=>{e.exports=r.p+"static/media/Sigmar-Regular.daeeaca2f7490cb1c50c.ttf"},8075:(e,t,r)=>{e.exports=r.p+"static/media/avocado.667d95040b7743f10475.jpg"}},t={};function r(a){var n=t[a];if(void 0!==n)return n.exports;var l=t[a]={id:a,loaded:!1,exports:{}};return e[a].call(l.exports,l,l.exports,r),l.loaded=!0,l.exports}r.m=e,(()=>{var e=[];r.O=(t,a,n,l)=>{if(!a){var o=1/0;for(s=0;s<e.length;s++){for(var[a,n,l]=e[s],i=!0,u=0;u<a.length;u++)(!1&l||o>=l)&&Object.keys(r.O).every((e=>r.O[e](a[u])))?a.splice(u--,1):(i=!1,l<o&&(o=l));if(i){e.splice(s--,1);var d=n();void 0!==d&&(t=d)}}return t}l=l||0;for(var s=e.length;s>0&&e[s-1][2]>l;s--)e[s]=e[s-1];e[s]=[a,n,l]}})(),r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},(()=>{var e,t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;r.t=function(a,n){if(1&n&&(a=this(a)),8&n)return a;if("object"===typeof a&&a){if(4&n&&a.__esModule)return a;if(16&n&&"function"===typeof a.then)return a}var l=Object.create(null);r.r(l);var o={};e=e||[null,t({}),t([]),t(t)];for(var i=2&n&&a;"object"==typeof i&&!~e.indexOf(i);i=t(i))Object.getOwnPropertyNames(i).forEach((e=>o[e]=()=>a[e]));return o.default=()=>a,r.d(l,o),l}})(),r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r.p="/",(()=>{var e={179:0};r.O.j=t=>0===e[t];var t=(t,a)=>{var n,l,[o,i,u]=a,d=0;if(o.some((t=>0!==e[t]))){for(n in i)r.o(i,n)&&(r.m[n]=i[n]);if(u)var s=u(r)}for(t&&t(a);d<o.length;d++)l=o[d],r.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return r.O(s)},a=self.webpackChunkweb=self.webpackChunkweb||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))})();var a=r.O(void 0,[37],(()=>r(9215)));a=r.O(a)})();
|
2 |
+
//# sourceMappingURL=main.8ba1c129.js.map
|
web-build/static/js/main.8ba1c129.js.map
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"version":3,"file":"static/js/main.8ba1c129.js","mappings":"qNAGe,SAASA,EAAWC,GAAwB,IAArBC,EAAgBD,EAAhBC,iBACpC,OACEC,EAAAA,EAAAA,KAACC,EAAAA,QAAK,CAACC,OAAQH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oBY,EAAEC,EAAO,EAGjCyD,EAAqBC,KAAsB,gBAAIA,KAAsB,iBAAK,GAC9ED,EAAmBhM,QAAQ2L,EAAqBO,KAAK,KAAM,IAC3DF,EAAmBG,KAAOR,EAAqBO,KAAK,KAAMF,EAAmBG,KAAKD,KAAKF,G,KC7CvF,IAAII,EAAsB1E,EAAoBY,OAAET,EAAW,CAAC,KAAK,IAAOH,EAAoB,QAC5F0E,EAAsB1E,EAAoBY,EAAE8D,E","sources":["components/ImageViewer.js","components/Slider.js","components/PromptInput.js","components/Breathing.js","components/DropDown.js","App.js","webpack/bootstrap","webpack/runtime/chunk loaded","webpack/runtime/compat get default export","webpack/runtime/create fake namespace object","webpack/runtime/define property getters","webpack/runtime/global","webpack/runtime/hasOwnProperty shorthand","webpack/runtime/make namespace object","webpack/runtime/node module decorator","webpack/runtime/publicPath","webpack/runtime/jsonp chunk loading","webpack/startup"],"sourcesContent":["import React from 'react';\r\nimport { StyleSheet, Image } from 'react-native';\r\n\r\nexport default function ImageViewer({ PlaceholderImage }) {\r\n return (\r\n <Image source={PlaceholderImage} style={styles.imageStyle} />\r\n );\r\n}\r\n\r\nconst styles = StyleSheet.create({\r\n imageStyle: {\r\n width: 320,\r\n height: 440,\r\n borderRadius: 18,\r\n marginTop: 20,\r\n marginBottom: 20,\r\n alignSelf: 'center',\r\n },\r\n});","import * as React from 'react';\r\nimport { StyleSheet, View, Text } from 'react-native';\r\nimport Slider from \"@react-native-community/slider\";\r\n\r\nexport default function SliderComponent({ passSteps, passGuidance }) {\r\n const [samplingValue, setSamplingValue] = React.useState(45);\r\n const [guidanceValue, setGuidanceValue] = React.useState(50);\r\n \r\n // Handle sampling steps change\r\n const handleStepChange = (x) => {\r\n setSamplingValue(x);\r\n passSteps(x);\r\n }\r\n\r\n // Handle guidance change\r\n const handleGuidanceChange = (x) => {\r\n setGuidanceValue(x);\r\n passGuidance(x);\r\n }\r\n\r\n return (\r\n <View style={styles.container}>\r\n <Text style={styles.captionText}>Sampling Steps</Text>\r\n <Slider\r\n style={styles.slider}\r\n minimumValue={3}\r\n maximumValue={50}\r\n step={1}\r\n value={samplingValue}\r\n minimumTrackTintColor=\"#958DA5\"\r\n maximumTrackTintColor=\"#9DA58D\"\r\n thumbTintColor='#6750A4'\r\n onValueChange={handleStepChange}\r\n />\r\n <Text style={styles.sliderValue}>{samplingValue}</Text>\r\n <Text style={styles.captionText}>Guidance</Text>\r\n <Slider\r\n style={styles.slider}\r\n minimumValue={0}\r\n maximumValue={100}\r\n step={0.1}\r\n value={guidanceValue}\r\n minimumTrackTintColor=\"#958DA5\"\r\n maximumTrackTintColor=\"#9DA58D\"\r\n thumbTintColor='#6750A4'\r\n onValueChange={handleGuidanceChange}\r\n />\r\n <Text style={styles.sliderValue}>{guidanceValue}</Text>\r\n </View>\r\n );\r\n}\r\n\r\nconst styles = StyleSheet.create({\r\n container: {\r\n alignItems: 'center',\r\n paddingTop: 50,\r\n },\r\n slider: {\r\n width: 400,\r\n height: 40,\r\n },\r\n sliderValue: {\r\n fontSize: 18,\r\n color: '#FFFFFF',\r\n textAlign: 'center',\r\n fontFamily: 'Sigmar',\r\n letterSpacing: 3,\r\n paddingBottom: 30\r\n },\r\n captionText: {\r\n color: '#FFFFFF',\r\n fontSize: 20,\r\n textAlign: 'center',\r\n fontFamily: 'Sigmar',\r\n letterSpacing: 3,\r\n },\r\n});\r\n","import React from 'react';\r\nimport { StyleSheet, TextInput, useWindowDimensions } from 'react-native';\r\n\r\nexport default function PromptInputComponent({ passPrompt }) {\r\n const [text, setText] = React.useState('');\r\n const {width} = useWindowDimensions();\r\n \r\n const textInputStyle = { \r\n ...styles.input, width: width > 500 ? 500 : width - 80};\r\n \r\n const handleTextChange = (x) => {\r\n setText(x);\r\n passPrompt(x);\r\n }\r\n\r\n return (\r\n <TextInput \r\n style={textInputStyle}\r\n placeholder='Avocado Armchair'\r\n multiline\r\n onChangeText={handleTextChange} \r\n value={text}\r\n maxLength={200} \r\n />\r\n );\r\n\r\n};\r\n\r\nconst styles = StyleSheet.create({\r\n input: {\r\n backgroundColor: '#FFFFFF',\r\n borderColor: '#B58392',\r\n borderWidth: 4,\r\n borderBottomLeftRadius: 4,\r\n borderBottomRightRadius: 4,\r\n borderStartWidth: 10,\r\n borderEndWidth: 10,\r\n borderRadius: 6,\r\n height: 80,\r\n paddingLeft: 10,\r\n paddingRight: 10,\r\n fontSize: 20,\r\n fontFamily: 'Sigmar',\r\n },\r\n});","import React, { useEffect, useRef } from 'react';\r\nimport { View, Text, StyleSheet, Animated, useWindowDimensions } from 'react-native';\r\n\r\nexport default function Breathing() {\r\n // Create an array of Animated values using useRef\r\n const animatedValues = useRef([...Array(12)].map(() => new Animated.Value(0))).current;\r\n const {width} = useWindowDimensions();\r\n\r\n useEffect(() => {\r\n // Define animations for each value in animatedValues\r\n const animations = animatedValues.map((animatedValue, index) => {\r\n // Animation for increasing value\r\n const animation1 = Animated.timing(animatedValue, {\r\n toValue: 1,\r\n duration: 2000,\r\n useNativeDriver: false,\r\n });\r\n\r\n // Animation for decreasing value\r\n const animation2 = Animated.timing(animatedValue, {\r\n toValue: 0,\r\n duration: 2000,\r\n useNativeDriver: false,\r\n });\r\n\r\n const fast = 300;\r\n const medium = 450;\r\n const slow = 600;\r\n // Define delays for each animation\r\n const delays = [\r\n index * fast,\r\n index * medium,\r\n (11 - index) * fast,\r\n index * slow,\r\n (11 - index) * medium, \r\n index * fast,\r\n (11 - index) * slow,\r\n index * medium,\r\n (11 - index) * fast,\r\n (11 - index) * medium,\r\n index * slow,\r\n (11 - index) * slow,\r\n ];\r\n\r\n // Create a sequence of animations with delays\r\n const animationSequence = delays.map((delay, index) => {\r\n return Animated.sequence([\r\n Animated.delay(delay),\r\n animation1,\r\n animation2,\r\n ]);\r\n });\r\n\r\n // Create a sequence of all animation sequences\r\n const animationSequences = Animated.sequence(animationSequence);\r\n \r\n // Create a loop for the animation sequence\r\n return Animated.loop(animationSequences);\r\n });\r\n\r\n // Start all animations\r\n animations.forEach((animation) => {\r\n animation.start();\r\n });\r\n }, [animatedValues]);\r\n\r\n // Interpolate animations to map values to desired output range\r\n const interpolateAnimations = animatedValues.map((animatedValue) =>\r\n animatedValue.interpolate({\r\n inputRange: [0, 1],\r\n outputRange: width > 1000 ? [60, 90] : [20, 30],\r\n extrapolate: 'clamp',\r\n })\r\n );\r\n\r\n // Create animated styles based on interpolated values\r\n const animatedStyles = interpolateAnimations.map((interpolateAnimation) => ({\r\n fontSize: interpolateAnimation,\r\n }));\r\n\r\n return (\r\n <View style={styles.containerbreathing}>\r\n <Text style={styles.heading}>\r\n <Animated.Text style={[styles.char, animatedStyles[0]]}>R</Animated.Text>\r\n <Animated.Text style={[styles.char, animatedStyles[1]]}>E</Animated.Text>\r\n <Animated.Text style={[styles.char, animatedStyles[2]]}>A</Animated.Text>\r\n <Animated.Text style={[styles.char, animatedStyles[3]]}>C</Animated.Text>\r\n <Animated.Text style={[styles.char, animatedStyles[4]]}>T</Animated.Text>\r\n <Animated.Text style={[styles.char, animatedStyles[5]]}>-</Animated.Text>\r\n <Animated.Text style={[styles.char, animatedStyles[6]]}>N</Animated.Text>\r\n <Animated.Text style={[styles.char, animatedStyles[7]]}>A</Animated.Text>\r\n <Animated.Text style={[styles.char, animatedStyles[8]]}>T</Animated.Text>\r\n <Animated.Text style={[styles.char, animatedStyles[9]]}>I</Animated.Text>\r\n <Animated.Text style={[styles.char, animatedStyles[10]]}>V</Animated.Text>\r\n <Animated.Text style={[styles.char, animatedStyles[11]]}>E</Animated.Text>\r\n </Text>\r\n </View>\r\n );\r\n};\r\n\r\nconst styles = StyleSheet.create({\r\n containerbreathing: {\r\n flex: 1/8,\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n },\r\n heading: {\r\n fontWeight: 'bold',\r\n fontWeight: '20',\r\n color: '#6750A4',\r\n fontFamily: 'Sigmar',\r\n posistion:'absolute',\r\n top:0,\r\n left: 0,\r\n },\r\n char: {\r\n marginHorizontal: 15,\r\n },\r\n });\r\n","import React, { useState } from 'react';\r\nimport { StyleSheet } from 'react-native';\r\nimport { Dropdown } from 'react-native-element-dropdown';\r\n\r\nconst data = [\r\n { label: 'Open Journey', value: 'prompthero/openjourney' },\r\n { label: 'Photo', value: 'dreamlike-art/dreamlike-photoreal-2.0' },\r\n { label: 'Arcane', value: 'nitrosocke/Arcane-Diffusion' },\r\n { label: 'Van-Gogh', value: 'dallinmackay/Van-Gogh-diffusion' },\r\n { label: 'Robots', value: 'nousr/robo-diffusion' }\r\n];\r\n\r\nexport default function DropDownComponent({passModelID}){\r\n\r\n return (\r\n <Dropdown\r\n style={styles.dropdown}\r\n selectedTextStyle={styles.selectedTextStyle}\r\n placeholderStyle={styles.placeholderStyle}\r\n data={data}\r\n labelField=\"label\"\r\n valueField=\"value\"\r\n placeholder=\"Model ID\"\r\n onChange={item => {\r\n passModelID(item.value);\r\n }}\r\n \r\n />\r\n );\r\n};\r\n\r\nconst styles = StyleSheet.create({\r\n dropdown: {\r\n margin: 16,\r\n height: 50,\r\n width: 300,\r\n borderBottomColor: '#9DA58D',\r\n borderBottomWidth: 3,\r\n },\r\n placeholderStyle: {\r\n fontSize: 25,\r\n color: '#FFFFFF',\r\n textAlign: 'center',\r\n fontFamily: 'Sigmar',\r\n letterSpacing: 3,\r\n },\r\n selectedTextStyle: {\r\n fontSize: 20,\r\n letterSpacing: 3,\r\n color: '#FFFFFF',\r\n textAlign: 'center',\r\n fontFamily: 'Sigmar',\r\n },\r\n});","import { registerRootComponent } from 'expo';\r\nimport { StatusBar } from 'expo-status-bar';\r\nimport React, { useState, useEffect} from 'react';\r\nimport {ActivityIndicator, StyleSheet, View, ScrollView, Text, Pressable, useWindowDimensions} from 'react-native';\r\nimport axios from 'axios';\r\n\r\nimport ImageViewerComponent from './components/ImageViewer';\r\nimport SliderComponent from './components/Slider';\r\nimport PromptInputComponent from './components/PromptInput';\r\nimport BreathingComponent from './components/Breathing';\r\nimport DropDownComponent from './components/DropDown';\r\nimport {useFonts } from 'expo-font'; \r\n\r\nconst assetImage = require('./assets/avocado.jpg');\r\n\r\nexport default function App() {\r\n useFonts({'Sigmar': require('./assets/Sigmar/Sigmar-Regular.ttf')});\r\n const [inferredImage, setInferredImage] = useState(assetImage);\r\n const [steps, setSteps] = useState(45);\r\n const [guidance, setGuidance] = useState(45);\r\n const [modelID, setModelID] = useState('prompthero/openjourney')\r\n const [prompt, setPrompt] = useState('Avocado Armchair');\r\n const [parameters, setParameters] = useState('')\r\n const [activity, setActivity] = useState(false);\r\n const [modelError, setModelError] = useState(false);\r\n const [returnedPrompt, setReturnedPrompt] = useState('Avocado Armchair');\r\n const {width} = useWindowDimensions();\r\n\r\n const passPromptWrapper = (x) => {setPrompt(x)};\r\n const passStepsWrapper = (x) => {setSteps(x)};\r\n const passGuidanceWrapper = (x) => {setGuidance(x)};\r\n const passModelIDWrapper = (x) => {\r\n setModelError(false);\r\n setModelID(x)};\r\n \r\n useEffect(() => {\r\n if (parameters != ''){\r\n setActivity(true);\r\n axios.post(\"/api\", {\r\n // Create Body to send to our backend\r\n prompt: prompt,\r\n steps: steps,\r\n guidance: guidance,\r\n modelID: modelID\r\n })\r\n .then(response => {\r\n console.log(response);\r\n setActivity(false);\r\n setReturnedPrompt(prompt);\r\n setInferredImage('data:image/png;base64,' + response.data.output);\r\n })\r\n .catch(function (error) {\r\n setActivity(false);\r\n setModelError(true);\r\n console.log(error);\r\n });\r\n }\r\n },[parameters]);\r\n\r\n return (\r\n // Main container\r\n <View style={styles.titlecontainer}>\r\n <BreathingComponent /> \r\n <ScrollView scrollY={true} style={styles.ScrollView}> \r\n {width > 1000 ? (<View style={styles.rowContainer}>\r\n {/* Left column */}\r\n <View style={styles.columnContainer}>\r\n <View>\r\n <PromptInputComponent passPrompt={passPromptWrapper} />\r\n </View>\r\n <View style={styles.rowContainer}>\r\n <DropDownComponent passModelID={passModelIDWrapper} />\r\n <View style={styles.columnContainer}>\r\n {activity ?\r\n <ActivityIndicator size=\"large\" color=\"#B58392\" style={styles.activityIndicator} /> :\r\n <Pressable\r\n onPress={() => { setParameters(`${prompt}-${steps}-${guidance}-${modelID}`); } }\r\n style={({ pressed }) => [{ backgroundColor: pressed ? '#9DA58D' : '#958DA5', }, styles.button]}>\r\n {({ pressed }) => (<Text style={styles.promptText}>{pressed ? 'INFERRED!' : 'Inference'}</Text>)}\r\n </Pressable>}\r\n {modelError ? <Text style={styles.promptText}>Model Error!</Text>:<></>}\r\n </View>\r\n </View>\r\n <View>\r\n <SliderComponent passSteps={passStepsWrapper} passGuidance={passGuidanceWrapper} />\r\n </View>\r\n </View>\r\n {/* Right column */}\r\n <View style={styles.columnContainer}>\r\n <View style={styles.columnContainer}>\r\n <ImageViewerComponent PlaceholderImage={inferredImage} />\r\n <Text style={styles.promptText}>{returnedPrompt}</Text>\r\n </View>\r\n </View>\r\n \r\n </View>) : \r\n (<View style={styles.columnContainer}>\r\n <PromptInputComponent passPrompt={passPromptWrapper} />\r\n <DropDownComponent passModelID={passModelIDWrapper} />\r\n {activity ?\r\n <ActivityIndicator size=\"large\" color=\"#B58392\"/> :\r\n <Pressable\r\n onPress={() => { setParameters(`${prompt}-${steps}-${guidance}-${modelID}`); } }\r\n style={({ pressed }) => [{ backgroundColor: pressed ? '#9DA58D' : '#958DA5', }, styles.button]}>\r\n {({ pressed }) => (<Text style={styles.promptText}>{pressed ? 'INFERRED!' : 'Inference'}</Text>)}\r\n </Pressable>}\r\n {modelError ? <Text style={styles.promptText}>Model Error!</Text>:<></>}\r\n <SliderComponent passSteps={passStepsWrapper} passGuidance={passGuidanceWrapper} /> \r\n <ImageViewerComponent PlaceholderImage={inferredImage} />\r\n <Text style={styles.promptText}>{returnedPrompt}</Text>\r\n </View>)}\r\n </ScrollView><StatusBar style=\"auto\" />\r\n </View>\r\n );\r\n}\r\n\r\nconst styles = StyleSheet.create({\r\n canvascontainer: {\r\n backgroundColor: '#25292e',\r\n position: 'fixed',\r\n top: 0,\r\n left: 0,\r\n right: 0,\r\n bottom: 0, \r\n padding: 50\r\n },\r\n titlecontainer: {\r\n backgroundColor: '#25292e',\r\n position: 'fixed',\r\n top: 0,\r\n left: 0,\r\n right: 0,\r\n bottom: 0, \r\n padding: 50\r\n },\r\n rowContainer: {\r\n flex: 1,\r\n backgroundColor: '#25292e',\r\n flexDirection: 'row',\r\n alignItems: 'center',\r\n marginTop: 10,\r\n overflow: 'auto',\r\n padding: 20\r\n },\r\n columnContainer: {\r\n flex: 1,\r\n alignItems: 'center',\r\n flexDirection: 'column',\r\n },\r\n button:{\r\n fontFamily: 'Sigmar',\r\n paddingHorizontal: 32,\r\n borderRadius: 4,\r\n elevation: 3\r\n },\r\n activityIndicator:{\r\n marginLeft: 50\r\n },\r\n promptText: {\r\n color: '#FFFFFF',\r\n fontSize: 18,\r\n fontWeight: 'italic',\r\n textAlign: 'center',\r\n wordWrap: 'break-word',\r\n fontFamily: 'Sigmar',\r\n letterSpacing: 2,\r\n lineHeight: 30\r\n },\r\n ScrollView: {\r\n backgroundColor: '#25292e',\r\n marginTop: 50,\r\n padding: 5\r\n }\r\n});\r\n\r\nregisterRootComponent(App);","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));\n\t}\n\tdef['default'] = () => (value);\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.p = \"/\";","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t179: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkweb\"] = self[\"webpackChunkweb\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [37], () => (__webpack_require__(9215)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["ImageViewer","_ref","PlaceholderImage","_jsx","Image","source","style","styles","imageStyle","StyleSheet","create","width","height","borderRadius","marginTop","marginBottom","alignSelf","SliderComponent","passSteps","passGuidance","_React$useState","React","_React$useState2","_slicedToArray","samplingValue","setSamplingValue","_React$useState3","_React$useState4","guidanceValue","setGuidanceValue","_jsxs","View","container","children","Text","captionText","Slider","slider","minimumValue","maximumValue","step","value","minimumTrackTintColor","maximumTrackTintColor","thumbTintColor","onValueChange","x","sliderValue","alignItems","paddingTop","fontSize","color","textAlign","fontFamily","letterSpacing","paddingBottom","PromptInputComponent","passPrompt","text","setText","useWindowDimensions","textInputStyle","_objectSpread","input","TextInput","placeholder","multiline","onChangeText","maxLength","backgroundColor","borderColor","borderWidth","borderBottomLeftRadius","borderBottomRightRadius","borderStartWidth","borderEndWidth","paddingLeft","paddingRight","Breathing","animatedValues","useRef","_toConsumableArray","Array","map","Animated","Value","current","useEffect","animatedValue","index","animation1","timing","toValue","duration","useNativeDriver","animation2","fast","medium","slow","animationSequence","delay","sequence","animationSequences","loop","forEach","animation","start","animatedStyles","interpolate","inputRange","outputRange","extrapolate","interpolateAnimation","containerbreathing","heading","char","flex","justifyContent","fontWeight","posistion","top","left","marginHorizontal","data","label","DropDownComponent","passModelID","Dropdown","dropdown","selectedTextStyle","placeholderStyle","labelField","valueField","onChange","item","margin","borderBottomColor","borderBottomWidth","assetImage","require","App","useFonts","_useState","useState","_useState2","inferredImage","setInferredImage","_useState3","_useState4","steps","setSteps","_useState5","_useState6","guidance","setGuidance","_useState7","_useState8","modelID","setModelID","_useState9","_useState10","prompt","setPrompt","_useState11","_useState12","parameters","setParameters","_useState13","_useState14","activity","setActivity","_useState15","_useState16","modelError","setModelError","_useState17","_useState18","returnedPrompt","setReturnedPrompt","passPromptWrapper","passStepsWrapper","passGuidanceWrapper","passModelIDWrapper","axios","post","then","response","console","log","output","catch","error","titlecontainer","BreathingComponent","ScrollView","scrollY","rowContainer","columnContainer","ActivityIndicator","size","activityIndicator","Pressable","onPress","pressed","button","_ref2","promptText","_Fragment","ImageViewerComponent","_ref3","_ref4","StatusBar","canvascontainer","position","right","bottom","padding","flexDirection","overflow","paddingHorizontal","elevation","marginLeft","wordWrap","lineHeight","registerRootComponent","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","id","loaded","__webpack_modules__","call","m","deferred","O","result","chunkIds","fn","priority","notFulfilled","Infinity","i","length","fulfilled","j","Object","keys","every","key","splice","r","n","getter","__esModule","d","a","leafPrototypes","getProto","getPrototypeOf","obj","t","mode","this","ns","def","indexOf","getOwnPropertyNames","definition","o","defineProperty","enumerable","get","g","globalThis","Function","e","window","prop","prototype","hasOwnProperty","Symbol","toStringTag","nmd","paths","p","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","self","bind","push","__webpack_exports__"],"sourceRoot":""}
|
web-build/static/media/Sigmar-Regular.daeeaca2f7490cb1c50c.ttf
ADDED
Binary file (172 kB). View file
|
|
web-build/static/media/avocado.667d95040b7743f10475.jpg
ADDED
![]() |