Qwael 4.0.0.2.1__tar.gz → 4.0.4.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Qwael
3
- Version: 4.0.0.2.1
3
+ Version: 4.0.4.1
4
4
  Summary: Qwael: İşlevsel ve kolaylaştırılmış Python kütüphanesi
5
5
  Author: Bedirhan
6
6
  Author-email: bedirhan.oytpass@gmail.com
@@ -15,19 +15,14 @@ Classifier: Programming Language :: Python :: 3.9
15
15
  Classifier: Programming Language :: Python :: 3.10
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
- Requires-Dist: torch
19
- Requires-Dist: diffusers
20
- Requires-Dist: transformers
21
- Requires-Dist: accelerate
22
- Requires-Dist: safetensors
23
- Requires-Dist: deep-translator
24
- Requires-Dist: Pillow
25
- Requires-Dist: requests
26
- Requires-Dist: tqdm
27
18
  Requires-Dist: google-api-python-client
28
19
  Requires-Dist: google-auth
29
20
  Requires-Dist: google-auth-oauthlib
30
21
  Requires-Dist: google-auth-httplib2
22
+ Requires-Dist: Pillow
23
+ Requires-Dist: flask
24
+ Requires-Dist: pyyaml
25
+ Requires-Dist: requests
31
26
  Dynamic: author
32
27
  Dynamic: author-email
33
28
  Dynamic: classifier
@@ -0,0 +1,59 @@
1
+ from flask import Flask
2
+ import yaml
3
+
4
+ class Web:
5
+ def __init__(self, name):
6
+ self.app = Flask(name)
7
+
8
+ def route(self, path):
9
+ return self.app.route(path)
10
+
11
+ def run(self):
12
+ self.app.run(debug=True)
13
+
14
+
15
+ class UI:
16
+ @staticmethod
17
+ def load_ted(name):
18
+ with open(f"{name}.ted", "r", encoding="utf-8") as f:
19
+ data = yaml.safe_load(f.read())
20
+
21
+ root = data.get("</>")
22
+ html = ""
23
+
24
+ for widget_name, props in root.items():
25
+ if widget_name == "Label":
26
+ html += Label(props).render()
27
+
28
+ return f"""
29
+ <html>
30
+ <body style="position:relative;">
31
+ {html}
32
+ </body>
33
+ </html>
34
+ """
35
+
36
+
37
+ class Label:
38
+ def __init__(self, props):
39
+ self.text = props.get("text", "")
40
+ pos = props.get("pos", {})
41
+ size = props.get("size", {})
42
+
43
+ self.x = pos.get("x", 0)
44
+ self.y = pos.get("y", 0)
45
+ self.w = size.get("x", 100)
46
+ self.h = size.get("y", 30)
47
+
48
+ def render(self):
49
+ return f"""
50
+ <div style="
51
+ position:absolute;
52
+ left:{self.x}px;
53
+ top:{self.y}px;
54
+ width:{self.w}px;
55
+ height:{self.h}px;
56
+ ">
57
+ {self.text}
58
+ </div>
59
+ """
@@ -5,4 +5,4 @@ from .DRİVE import delete
5
5
  from .DRİVE import get
6
6
  from .DoIP import IP
7
7
  from .filesz import EasyDB
8
- from .vto01 import create_text
8
+ from .EasyWeb import Web
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: Qwael
3
- Version: 4.0.0.2.1
3
+ Version: 4.0.4.1
4
4
  Summary: Qwael: İşlevsel ve kolaylaştırılmış Python kütüphanesi
5
5
  Author: Bedirhan
6
6
  Author-email: bedirhan.oytpass@gmail.com
@@ -15,19 +15,14 @@ Classifier: Programming Language :: Python :: 3.9
15
15
  Classifier: Programming Language :: Python :: 3.10
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
- Requires-Dist: torch
19
- Requires-Dist: diffusers
20
- Requires-Dist: transformers
21
- Requires-Dist: accelerate
22
- Requires-Dist: safetensors
23
- Requires-Dist: deep-translator
24
- Requires-Dist: Pillow
25
- Requires-Dist: requests
26
- Requires-Dist: tqdm
27
18
  Requires-Dist: google-api-python-client
28
19
  Requires-Dist: google-auth
29
20
  Requires-Dist: google-auth-oauthlib
30
21
  Requires-Dist: google-auth-httplib2
22
+ Requires-Dist: Pillow
23
+ Requires-Dist: flask
24
+ Requires-Dist: pyyaml
25
+ Requires-Dist: requests
31
26
  Dynamic: author
32
27
  Dynamic: author-email
33
28
  Dynamic: classifier
@@ -3,12 +3,12 @@ README.md
3
3
  setup.py
4
4
  Qwael/DRİVE.py
5
5
  Qwael/DoIP.py
6
+ Qwael/EasyWeb.py
6
7
  Qwael/MultiDB.py
7
8
  Qwael/Multidata.py
8
9
  Qwael/__init__.py
9
10
  Qwael/filesz.py
10
11
  Qwael/pgif.py
11
- Qwael/vto01.py
12
12
  Qwael.egg-info/PKG-INFO
13
13
  Qwael.egg-info/SOURCES.txt
14
14
  Qwael.egg-info/dependency_links.txt
@@ -1,13 +1,8 @@
1
- torch
2
- diffusers
3
- transformers
4
- accelerate
5
- safetensors
6
- deep-translator
7
- Pillow
8
- requests
9
- tqdm
10
1
  google-api-python-client
11
2
  google-auth
12
3
  google-auth-oauthlib
13
4
  google-auth-httplib2
5
+ Pillow
6
+ flask
7
+ pyyaml
8
+ requests
@@ -5,22 +5,17 @@ with open("README.md", "r", encoding="utf-8") as f:
5
5
 
6
6
  setup(
7
7
  name="Qwael",
8
- version="4.0.0.2.1",
8
+ version="4.0.4.1",
9
9
  packages=find_packages(),
10
10
  install_requires=[
11
- "torch",
12
- "diffusers",
13
- "transformers",
14
- "accelerate",
15
- "safetensors",
16
- "deep-translator",
17
- "Pillow",
18
- "requests",
19
- "tqdm",
20
11
  "google-api-python-client",
21
12
  "google-auth",
22
13
  "google-auth-oauthlib",
23
14
  "google-auth-httplib2",
15
+ "Pillow",
16
+ "flask",
17
+ "pyyaml",
18
+ "requests",
24
19
  ],
25
20
  description="Qwael: İşlevsel ve kolaylaştırılmış Python kütüphanesi",
26
21
  long_description=README,
@@ -1,87 +0,0 @@
1
- import torch
2
- import random
3
- import os
4
- from datetime import datetime
5
- from diffusers import StableDiffusionPipeline, DPMSolverMultistepScheduler
6
- from deep_translator import GoogleTranslator
7
-
8
- device = "cuda" if torch.cuda.is_available() else "cpu"
9
- dtype = torch.float16 if device == "cuda" else torch.float32
10
-
11
- TR_STYLE_MAP = {
12
- "gerçekçi": "realistic",
13
- "sinematik": "cinematic lighting",
14
- "anime": "anime style",
15
- "çizgi film": "cartoon style",
16
- "karanlık": "dark dramatic mood",
17
- "neon": "neon cyberpunk lighting",
18
- "portre": "portrait photography",
19
- "detaylı": "highly detailed",
20
- "fantastik": "fantasy art",
21
- "bilim kurgu": "science fiction",
22
- "minimal": "minimalist composition"
23
- }
24
-
25
- QUALITY_LOCK = (
26
- "masterpiece, ultra high quality, professional photography, "
27
- "sharp focus, perfect lighting, high detail, clean composition"
28
- )
29
-
30
- NEGATIVE_LOCK = (
31
- "worst quality, low quality, lowres, blurry, jpeg artifacts, "
32
- "bad anatomy, bad proportions, extra fingers, missing fingers, "
33
- "extra limbs, fused fingers, malformed hands, "
34
- "deformed face, asymmetrical face, cross eye, lazy eye, "
35
- "distorted body, mutated, ugly"
36
- )
37
-
38
- translator = GoogleTranslator(source="tr", target="en")
39
-
40
- def _build_prompt(prompt_tr: str) -> str:
41
- translated = translator.translate(prompt_tr)
42
- prompt_lower = prompt_tr.lower()
43
- styles = []
44
- for tr, en in TR_STYLE_MAP.items():
45
- if tr in prompt_lower:
46
- styles.append(en)
47
- parts = [translated]
48
- if styles:
49
- parts.append(", ".join(styles))
50
- parts.append(QUALITY_LOCK)
51
- return ", ".join(parts)
52
-
53
- _pipe = StableDiffusionPipeline.from_pretrained(
54
- "runwayml/stable-diffusion-v1-5",
55
- torch_dtype=dtype,
56
- safety_checker=None
57
- ).to(device)
58
-
59
- _pipe.scheduler = DPMSolverMultistepScheduler.from_config(_pipe.scheduler.config)
60
- _pipe.enable_attention_slicing()
61
-
62
- def create_text(
63
- prompt: str,
64
- kalite: float = 7.5,
65
- cfg: float = 7.5,
66
- steps: int | None = None,
67
- seed: int | None = None,
68
- filename: str | None = None
69
- ) -> str:
70
- final_prompt = _build_prompt(prompt)
71
- if steps is None:
72
- steps = int(20 + (kalite * 2))
73
- if seed is None:
74
- seed = random.randint(0, 999999999)
75
- generator = torch.Generator(device=device).manual_seed(seed)
76
- image = _pipe(
77
- prompt=final_prompt,
78
- negative_prompt=NEGATIVE_LOCK,
79
- num_inference_steps=steps,
80
- guidance_scale=float(cfg),
81
- generator=generator
82
- ).images[0]
83
- if filename is None:
84
- timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
85
- filename = f"ai_image_{timestamp}.png"
86
- image.save(filename)
87
- return os.path.abspath(filename)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes