vhup 0.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.
vhup-0.1/LICENSE ADDED
@@ -0,0 +1,33 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Bedirhan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "vhup"), known as
7
+ the vhup library and the vhup model, to deal in the Software without restriction,
8
+ including without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to permit
10
+ persons to whom the Software is furnished to do so, subject to the following
11
+ conditions:
12
+
13
+ 1. The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ 2. The Software is provided "as is", without warranty of any kind, express or
17
+ implied, including but not limited to the warranties of merchantability,
18
+ fitness for a particular purpose and noninfringement. In no event shall the
19
+ author be liable for any claim, damages or other liability, whether in an
20
+ action of contract, tort or otherwise, arising from, out of or in connection
21
+ with the Software or the use or other dealings in the Software.
22
+
23
+ 3. The Software (vhup) and the underlying model (vhup) do not implement any
24
+ additional content filtering, moderation, or censorship mechanisms beyond
25
+ those inherently present in the underlying machine learning frameworks or
26
+ models used. All content generated using the Software is produced at the
27
+ sole discretion and responsibility of the user.
28
+
29
+ 4. The author assumes no responsibility for the misuse of the Software or any
30
+ content generated through its use, including but not limited to illegal,
31
+ unethical, or harmful applications.
32
+
33
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
vhup-0.1/PKG-INFO ADDED
@@ -0,0 +1,42 @@
1
+ Metadata-Version: 2.4
2
+ Name: vhup
3
+ Version: 0.1
4
+ Summary: Vho: İşlevsel ve kolaylaştırılmış görsel oluşturma kütüphanesi
5
+ Author: Bedirhan
6
+ Author-email: bedirhan.oytpass@gmail.com
7
+ License: MIT
8
+ Keywords: görsel,kolay,basitleştirilmiş
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.6
12
+ Classifier: Programming Language :: Python :: 3.7
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: torch>=2.0.0
19
+ Requires-Dist: diffusers>=0.28.0
20
+ Requires-Dist: torchvision
21
+ Requires-Dist: controlnet-aux
22
+ Requires-Dist: opencv-python
23
+ Requires-Dist: transformers>=4.40.0
24
+ Requires-Dist: accelerate>=0.30.0
25
+ Requires-Dist: safetensors
26
+ Requires-Dist: imageio>=2.31.0
27
+ Requires-Dist: imageio-ffmpeg>=0.4.9
28
+ Requires-Dist: deep-translator
29
+ Requires-Dist: numpy
30
+ Requires-Dist: face_recognition
31
+ Requires-Dist: Pillow
32
+ Requires-Dist: insightface>=0.7.3
33
+ Requires-Dist: onnxruntime-gpu
34
+ Dynamic: author
35
+ Dynamic: author-email
36
+ Dynamic: classifier
37
+ Dynamic: description-content-type
38
+ Dynamic: keywords
39
+ Dynamic: license
40
+ Dynamic: license-file
41
+ Dynamic: requires-dist
42
+ Dynamic: summary
vhup-0.1/README.md ADDED
File without changes
vhup-0.1/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
vhup-0.1/setup.py ADDED
@@ -0,0 +1,44 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ with open("README.md", "r", encoding="utf-8") as f:
4
+ README = f.read()
5
+
6
+ setup(
7
+ name="vhup",
8
+ version="0.1",
9
+ packages=find_packages(),
10
+ install_requires=[
11
+ "torch>=2.0.0",
12
+ "diffusers>=0.28.0",
13
+ "torchvision",
14
+ "controlnet-aux",
15
+ "opencv-python",
16
+ "transformers>=4.40.0",
17
+ "accelerate>=0.30.0",
18
+ "safetensors",
19
+ "imageio>=2.31.0",
20
+ "imageio-ffmpeg>=0.4.9",
21
+ "deep-translator",
22
+ "numpy",
23
+ "face_recognition",
24
+ "Pillow",
25
+ "insightface>=0.7.3",
26
+ "onnxruntime-gpu"
27
+ ],
28
+ description="Vho: İşlevsel ve kolaylaştırılmış görsel oluşturma kütüphanesi",
29
+ long_description=README,
30
+ long_description_content_type="text/markdown",
31
+ author="Bedirhan",
32
+ author_email="bedirhan.oytpass@gmail.com",
33
+ license="MIT",
34
+ keywords=["görsel", "kolay", "basitleştirilmiş"],
35
+ classifiers=[
36
+ "License :: OSI Approved :: MIT License",
37
+ "Programming Language :: Python :: 3",
38
+ "Programming Language :: Python :: 3.6",
39
+ "Programming Language :: Python :: 3.7",
40
+ "Programming Language :: Python :: 3.8",
41
+ "Programming Language :: Python :: 3.9",
42
+ "Programming Language :: Python :: 3.10"
43
+ ],
44
+ )
@@ -0,0 +1 @@
1
+ from vhup import create_text
vhup-0.1/vhup/vhub.py ADDED
@@ -0,0 +1,98 @@
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
+ FIXED_OUTPUT_FILE = "vho1.png"
12
+
13
+ TR_STYLE_MAP = {
14
+ "gerçekçi": "realistic",
15
+ "sinematik": "cinematic lighting",
16
+ "anime": "anime style",
17
+ "çizgi film": "cartoon style",
18
+ "karanlık": "dark dramatic mood",
19
+ "neon": "neon cyberpunk lighting",
20
+ "portre": "portrait photography",
21
+ "detaylı": "highly detailed",
22
+ "fantastik": "fantasy art",
23
+ "bilim kurgu": "science fiction",
24
+ "minimal": "minimalist composition"
25
+ }
26
+
27
+ QUALITY_LOCK = (
28
+ "masterpiece, ultra high quality, professional photography, "
29
+ "sharp focus, perfect lighting, high detail, clean composition"
30
+ )
31
+
32
+ NEGATIVE_LOCK = (
33
+ "worst quality, low quality, lowres, blurry, jpeg artifacts, "
34
+ "bad anatomy, bad proportions, extra fingers, missing fingers, "
35
+ "extra limbs, fused fingers, malformed hands, "
36
+ "deformed face, asymmetrical face, cross eye, lazy eye, "
37
+ "distorted body, mutated, ugly"
38
+ )
39
+
40
+ translator = GoogleTranslator(source="tr", target="en")
41
+
42
+ def _build_prompt(prompt_tr: str) -> str:
43
+ translated = translator.translate(prompt_tr)
44
+ prompt_lower = prompt_tr.lower()
45
+ styles = []
46
+ for tr, en in TR_STYLE_MAP.items():
47
+ if tr in prompt_lower:
48
+ styles.append(en)
49
+
50
+ parts = [translated]
51
+ if styles:
52
+ parts.append(", ".join(styles))
53
+ parts.append(QUALITY_LOCK)
54
+ return ", ".join(parts)
55
+
56
+ _pipe = StableDiffusionPipeline.from_pretrained(
57
+ "runwayml/stable-diffusion-v1-5",
58
+ torch_dtype=dtype,
59
+ safety_checker=None
60
+ ).to(device)
61
+
62
+ _pipe.scheduler = DPMSolverMultistepScheduler.from_config(_pipe.scheduler.config)
63
+ _pipe.enable_attention_slicing()
64
+
65
+ def create_text(
66
+ prompt: str,
67
+ kalite: float = 7.5,
68
+ cfg: float = 7.5,
69
+ steps: int | None = None,
70
+ seed: int | None = None,
71
+ filename: str | None = None
72
+ ) -> str:
73
+ final_prompt = _build_prompt(prompt)
74
+
75
+ if steps is None:
76
+ steps = int(20 + (kalite * 2))
77
+
78
+ if seed is None:
79
+ seed = random.randint(0, 999999999)
80
+
81
+ generator = torch.Generator(device=device).manual_seed(seed)
82
+
83
+ image = _pipe(
84
+ prompt=final_prompt,
85
+ negative_prompt=NEGATIVE_LOCK,
86
+ num_inference_steps=steps,
87
+ guidance_scale=float(cfg),
88
+ generator=generator
89
+ ).images[0]
90
+
91
+ filename = FIXED_OUTPUT_FILE
92
+
93
+ if os.path.exists(filename):
94
+ os.remove(filename)
95
+
96
+ image.save(filename)
97
+ return os.path.abspath(filename)
98
+
@@ -0,0 +1,42 @@
1
+ Metadata-Version: 2.4
2
+ Name: vhup
3
+ Version: 0.1
4
+ Summary: Vho: İşlevsel ve kolaylaştırılmış görsel oluşturma kütüphanesi
5
+ Author: Bedirhan
6
+ Author-email: bedirhan.oytpass@gmail.com
7
+ License: MIT
8
+ Keywords: görsel,kolay,basitleştirilmiş
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3.6
12
+ Classifier: Programming Language :: Python :: 3.7
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: torch>=2.0.0
19
+ Requires-Dist: diffusers>=0.28.0
20
+ Requires-Dist: torchvision
21
+ Requires-Dist: controlnet-aux
22
+ Requires-Dist: opencv-python
23
+ Requires-Dist: transformers>=4.40.0
24
+ Requires-Dist: accelerate>=0.30.0
25
+ Requires-Dist: safetensors
26
+ Requires-Dist: imageio>=2.31.0
27
+ Requires-Dist: imageio-ffmpeg>=0.4.9
28
+ Requires-Dist: deep-translator
29
+ Requires-Dist: numpy
30
+ Requires-Dist: face_recognition
31
+ Requires-Dist: Pillow
32
+ Requires-Dist: insightface>=0.7.3
33
+ Requires-Dist: onnxruntime-gpu
34
+ Dynamic: author
35
+ Dynamic: author-email
36
+ Dynamic: classifier
37
+ Dynamic: description-content-type
38
+ Dynamic: keywords
39
+ Dynamic: license
40
+ Dynamic: license-file
41
+ Dynamic: requires-dist
42
+ Dynamic: summary
@@ -0,0 +1,10 @@
1
+ LICENSE
2
+ README.md
3
+ setup.py
4
+ vhup/__init__.py
5
+ vhup/vhub.py
6
+ vhup.egg-info/PKG-INFO
7
+ vhup.egg-info/SOURCES.txt
8
+ vhup.egg-info/dependency_links.txt
9
+ vhup.egg-info/requires.txt
10
+ vhup.egg-info/top_level.txt
@@ -0,0 +1,16 @@
1
+ torch>=2.0.0
2
+ diffusers>=0.28.0
3
+ torchvision
4
+ controlnet-aux
5
+ opencv-python
6
+ transformers>=4.40.0
7
+ accelerate>=0.30.0
8
+ safetensors
9
+ imageio>=2.31.0
10
+ imageio-ffmpeg>=0.4.9
11
+ deep-translator
12
+ numpy
13
+ face_recognition
14
+ Pillow
15
+ insightface>=0.7.3
16
+ onnxruntime-gpu
@@ -0,0 +1 @@
1
+ vhup