Mbonea commited on
Commit
e946d7d
·
1 Parent(s): a5737e1

_make_transcript

Browse files
App/Generate/database/DescriptAPI.py CHANGED
@@ -105,6 +105,13 @@ class Speak:
105
  self.api_url = api_url
106
  self.dir = dir
107
 
 
 
 
 
 
 
 
108
  async def _make_request(self, method, endpoint, json=None):
109
  async with aiohttp.ClientSession() as session:
110
  async with getattr(session, method)(
 
105
  self.api_url = api_url
106
  self.dir = dir
107
 
108
+ async def _make_transcript(self, links, text):
109
+ data = {"audio_url": links, "text": text}
110
+ response_data = await self._make_request(
111
+ "post", "descript_transcript", json=data
112
+ )
113
+ return response_data
114
+
115
  async def _make_request(self, method, endpoint, json=None):
116
  async with aiohttp.ClientSession() as session:
117
  async with getattr(session, method)(
App/Generate/database/Model.py CHANGED
@@ -120,12 +120,27 @@ class Project(orm.Model):
120
  "height": 1920,
121
  "width": 1080,
122
  }
 
 
 
 
 
123
 
124
  await self.update(**self.__dict__)
125
  return {"links": self.links, "assets": self.assets, "constants": self.constants}
126
 
127
  async def generate_transcript(self):
128
- pass
 
 
 
 
 
 
 
 
 
 
129
 
130
 
131
  class Scene(orm.Model):
 
120
  "height": 1920,
121
  "width": 1080,
122
  }
123
+ try:
124
+ data = await self.generate_transcript()
125
+ print(data)
126
+ except:
127
+ pass
128
 
129
  await self.update(**self.__dict__)
130
  return {"links": self.links, "assets": self.assets, "constants": self.constants}
131
 
132
  async def generate_transcript(self):
133
+ project_scenes: List[Scene] = self.get_all_scenes()
134
+ links = []
135
+ text = ""
136
+ for narration in project_scenes:
137
+ narration: Scene
138
+
139
+ text += " " + narration.narration
140
+ links.append(narration.narration_link)
141
+
142
+ transcript = await narration.tts._make_transcript(links=links, text=text)
143
+ return transcript
144
 
145
 
146
  class Scene(orm.Model):
App/Generate/database/Vercel.py CHANGED
@@ -20,7 +20,6 @@ class AsyncImageGenerator:
20
  "scheduler": "DPMSolver++",
21
  "num_outputs": 1,
22
  "guidance_scale": 2,
23
- "negative_prompt": "",
24
  # "negative_prompt": "ugly, deformed, noisy, blurry, distorted, out of focus, bad anatomy, extra limbs, poorly drawn face, poorly drawn hands, missing fingers, color, 3D, 2D, video game, cgi, plastic, fake, artificial, smooth",
25
  "negative_prompt": "text, watermark, blurry, haze, low contrast, low quality, underexposed, ugly, deformed, boring, bad quality, cartoon, ((disfigured)), ((bad art)), ((deformed)), ((poorly drawn)), ((extra limbs)), ((close up)), ((b&w)), weird colors, blurry, ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, body out of frame, blurry, bad anatomy, blurred, watermark, grainy, signature, cut off, draft, low detail, low quality, double face, 2 faces, cropped, ugly, low-res, tiling, grainy, cropped, ostentatious, ugly, oversaturated, grain, low resolution, disfigured, blurry, bad anatomy, disfigured, poorly drawn face, mutant, mutated, extra limb, ugly, poorly drawn hands, missing limbs, blurred, floating limbs, disjointed limbs, deformed hands, blurred, out of focus, long neck, long body, ugly, disgusting, childish, cut off cropped, distorted, imperfect, surreal, bad hands, text, error, extra digit, fewer digits, cropped , worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, artist name, Lots of hands, extra limbs, extra fingers, conjoined fingers, deformed fingers, old, ugly eyes, imperfect eyes, skewed eyes , unnatural face, stiff face, stiff body, unbalanced body, unnatural body, lacking body, details are not clear, cluttered, details are sticky, details are low, distorted details, ugly hands, imperfect hands, (mutated hands and fingers:1.5), (long body :1.3), (mutation, poorly drawn :1.2) bad hands, fused ha nd, missing hand, disappearing arms, hands, disappearing thigh, disappearing calf, disappearing legs, ui, missing fingers",
26
  "num_inference_steps": 25,
 
20
  "scheduler": "DPMSolver++",
21
  "num_outputs": 1,
22
  "guidance_scale": 2,
 
23
  # "negative_prompt": "ugly, deformed, noisy, blurry, distorted, out of focus, bad anatomy, extra limbs, poorly drawn face, poorly drawn hands, missing fingers, color, 3D, 2D, video game, cgi, plastic, fake, artificial, smooth",
24
  "negative_prompt": "text, watermark, blurry, haze, low contrast, low quality, underexposed, ugly, deformed, boring, bad quality, cartoon, ((disfigured)), ((bad art)), ((deformed)), ((poorly drawn)), ((extra limbs)), ((close up)), ((b&w)), weird colors, blurry, ugly, tiling, poorly drawn hands, poorly drawn feet, poorly drawn face, out of frame, extra limbs, disfigured, body out of frame, blurry, bad anatomy, blurred, watermark, grainy, signature, cut off, draft, low detail, low quality, double face, 2 faces, cropped, ugly, low-res, tiling, grainy, cropped, ostentatious, ugly, oversaturated, grain, low resolution, disfigured, blurry, bad anatomy, disfigured, poorly drawn face, mutant, mutated, extra limb, ugly, poorly drawn hands, missing limbs, blurred, floating limbs, disjointed limbs, deformed hands, blurred, out of focus, long neck, long body, ugly, disgusting, childish, cut off cropped, distorted, imperfect, surreal, bad hands, text, error, extra digit, fewer digits, cropped , worst quality, low quality, normal quality, jpeg artifacts, signature, watermark, username, blurry, artist name, Lots of hands, extra limbs, extra fingers, conjoined fingers, deformed fingers, old, ugly eyes, imperfect eyes, skewed eyes , unnatural face, stiff face, stiff body, unbalanced body, unnatural body, lacking body, details are not clear, cluttered, details are sticky, details are low, distorted details, ugly hands, imperfect hands, (mutated hands and fingers:1.5), (long body :1.3), (mutation, poorly drawn :1.2) bad hands, fused ha nd, missing hand, disappearing arms, hands, disappearing thigh, disappearing calf, disappearing legs, ui, missing fingers",
25
  "num_inference_steps": 25,