Iliya Zhechev commited on
Commit
a8189fb
2 Parent(s): 0924f9b 9577e92

Merge branch 'main' of github.com:ichko/text-brush

Browse files
server/poetry.lock CHANGED
@@ -137,6 +137,18 @@ Werkzeug = ">=2.2.2"
137
  async = ["asgiref (>=3.2)"]
138
  dotenv = ["python-dotenv"]
139
 
 
 
 
 
 
 
 
 
 
 
 
 
140
  [[package]]
141
  name = "huggingface-hub"
142
  version = "0.10.0"
@@ -370,6 +382,14 @@ urllib3 = ">=1.21.1,<1.27"
370
  socks = ["PySocks (>=1.5.6,!=1.5.7)"]
371
  use_chardet_on_py3 = ["chardet (>=3.0.2,<6)"]
372
 
 
 
 
 
 
 
 
 
373
  [[package]]
374
  name = "tokenizers"
375
  version = "0.12.1"
@@ -537,7 +557,7 @@ testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-
537
  [metadata]
538
  lock-version = "1.1"
539
  python-versions = "^3.9"
540
- content-hash = "60e4d68e194fc67ea38fbdd192e107a9eea2d7a809a662fc121e8011e613f0fc"
541
 
542
  [metadata.files]
543
  atomicwrites = []
@@ -553,6 +573,7 @@ colorama = []
553
  diffusers = []
554
  filelock = []
555
  flask = []
 
556
  huggingface-hub = []
557
  idna = []
558
  importlib-metadata = []
@@ -672,6 +693,10 @@ pyyaml = [
672
  ]
673
  regex = []
674
  requests = []
 
 
 
 
675
  tokenizers = []
676
  tomli = [
677
  {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"},
 
137
  async = ["asgiref (>=3.2)"]
138
  dotenv = ["python-dotenv"]
139
 
140
+ [[package]]
141
+ name = "flask-cors"
142
+ version = "3.0.10"
143
+ description = "A Flask extension adding a decorator for CORS support"
144
+ category = "main"
145
+ optional = false
146
+ python-versions = "*"
147
+
148
+ [package.dependencies]
149
+ Flask = ">=0.9"
150
+ Six = "*"
151
+
152
  [[package]]
153
  name = "huggingface-hub"
154
  version = "0.10.0"
 
382
  socks = ["PySocks (>=1.5.6,!=1.5.7)"]
383
  use_chardet_on_py3 = ["chardet (>=3.0.2,<6)"]
384
 
385
+ [[package]]
386
+ name = "six"
387
+ version = "1.16.0"
388
+ description = "Python 2 and 3 compatibility utilities"
389
+ category = "main"
390
+ optional = false
391
+ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*"
392
+
393
  [[package]]
394
  name = "tokenizers"
395
  version = "0.12.1"
 
557
  [metadata]
558
  lock-version = "1.1"
559
  python-versions = "^3.9"
560
+ content-hash = "36266ae2bd8cb7f60f9b8b2ac733a344d2e99e1e26890e9b4e6b4f844c2c7aa8"
561
 
562
  [metadata.files]
563
  atomicwrites = []
 
573
  diffusers = []
574
  filelock = []
575
  flask = []
576
+ flask-cors = []
577
  huggingface-hub = []
578
  idna = []
579
  importlib-metadata = []
 
693
  ]
694
  regex = []
695
  requests = []
696
+ six = [
697
+ {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"},
698
+ {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"},
699
+ ]
700
  tokenizers = []
701
  tomli = [
702
  {file = "tomli-2.0.1-py3-none-any.whl", hash = "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc"},
server/pyproject.toml CHANGED
@@ -10,6 +10,7 @@ Flask = "^2.2.2"
10
  torch = "^1.12.1"
11
  diffusers = "^0.4.1"
12
  transformers = "^4.22.2"
 
13
 
14
  [tool.poetry.dev-dependencies]
15
  pytest = "^5.2"
 
10
  torch = "^1.12.1"
11
  diffusers = "^0.4.1"
12
  transformers = "^4.22.2"
13
+ Flask-Cors = "^3.0.10"
14
 
15
  [tool.poetry.dev-dependencies]
16
  pytest = "^5.2"
server/text_brush/app.py CHANGED
@@ -4,8 +4,11 @@ import torch
4
  from torch import autocast
5
  from diffusers import StableDiffusionPipeline
6
  from io import BytesIO
 
 
7
 
8
  app = Flask(__name__)
 
9
 
10
 
11
  model_id = "CompVis/stable-diffusion-v1-4"
 
4
  from torch import autocast
5
  from diffusers import StableDiffusionPipeline
6
  from io import BytesIO
7
+ from flask_cors import CORS
8
+
9
 
10
  app = Flask(__name__)
11
+ CORS(app)
12
 
13
 
14
  model_id = "CompVis/stable-diffusion-v1-4"