Comments (19)
I've done the fork -> spawn thing, but that still gives me an error
(venv) Q:\PhotoMaker>python gradio_demo/app.py Traceback (most recent call last): File "gradio_demo/app.py", line 17, in from photomaker.pipeline import PhotoMakerStableDiffusionXLPipeline ModuleNotFoundError: No module named 'photomaker.pipeline'
Will try moving the folder...
I had to put all files from photomaker folder into the root where app.py is located @, removing the subfolder photomaker completly and adjusting the app.py as well as the pipeline.py to not look inside photomaker. folder for the modules
so it looks like:
- gradio_demo:
app.py
model.py
pipeline.py
sytle_template.py
I also had to change:
line 22 in pipeline.py
original: from photomaker.model import PhotoMakerIDEncoder
altered: from model import PhotoMakerIDEncoder
and
line 14 in app.py
original: from photomaker.pipeline import PhotoMakerStableDiffusionXLPipeline
altered: from pipeline import PhotoMakerStableDiffusionXLPipeline
EDIT: the issure with not finding the req files/modules in the subfolder might be caused by a missing init.py file inside that folder (can be an empty file)
from photomaker.
I've done the fork -> spawn thing, but that still gives me an error
(venv) Q:\PhotoMaker>python gradio_demo/app.py Traceback (most recent call last): File "gradio_demo/app.py", line 17, in from photomaker.pipeline import PhotoMakerStableDiffusionXLPipeline ModuleNotFoundError: No module named 'photomaker.pipeline'
Will try moving the folder...I had to put all files from photomaker folder into the root where app.py is located @, removing the subfolder photomaker completly and adjusting the app.py as well as the pipeline.py to not look inside photomaker. folder for the modules
so it looks like:
- gradio_demo:
app.py
model.py
pipeline.py
sytle_template.pyI also had to change:
line 22 in pipeline.py original: from photomaker.model import PhotoMakerIDEncoder altered: from model import PhotoMakerIDEncoder
and line 14 in app.py original: from photomaker.pipeline import PhotoMakerStableDiffusionXLPipeline altered: from pipeline import PhotoMakerStableDiffusionXLPipeline
This worked! Thank you so much!
from photomaker.
This seems to be an issue with spaces
on windows. Somewhat related to this: Issue #129
I solved it by editing line 42 in venv\Lib\site-packages\spaces\zero\wrappers.py
from:
Process = multiprocessing.get_context('fork').Process
to
Process = multiprocessing.get_context('spawn').Process
Also needed to drag the photomaker
directory containing the pipeline into the gradio_demo
folder.
Not sure if this is the ideal solution but a workaround on windows.
from photomaker.
Process = multiprocessing.get_context('fork').Process
Use python 3.10 or add these line in app.py :
add this line at the top ---> from typing import Tuple
find this line ---> def apply_style(style_name: str, positive: str, negative: str = "") -> tuple[str, str]:
and replace with this one ---> def apply_style(style_name: str, positive: str, negative: str = "") -> Tuple[str, str]:
it works for me :)
from photomaker.
Process = multiprocessing.get_context('fork').Process
Use python 3.10 or add these line in app.py :
add this line at the top --->
from typing import Tuple
find this line --->
def apply_style(style_name: str, positive: str, negative: str = "") -> tuple[str, str]:
and replace with this one --->
def apply_style(style_name: str, positive: str, negative: str = "") -> Tuple[str, str]:
yes, bad entry in readme - shoudl state required python 3.9 - this Tulpe error been the last error - now onto the stylized version :D
from photomaker.
Hello everyone, first of all, thank you for your discussions, which helped us fix many known issues in environment construction (in the latest version).
Now, you could update the environment building through:
conda create --name photomaker python=3.10
pip install -U pip
# Install requirements
pip install -r requirements.txt
# Install photomaker
pip install git+https://github.com/TencentARC/PhotoMaker.git
Then you can run the following command to use our PhotoMaker:
from photomaker import PhotoMakerStableDiffusionXLPipeline
The previous line can also be used outside the repo.
from photomaker.
Built Distributions
photomaker-1.0.1-py3-none-any.whl (4.1 kB view hashes)
Uploaded Nov 18, 2022 py3
photomaker-1.0.1-1-py3-none-any.whl (3.1 MB view hashes)
Uploaded Nov 18, 2022 py3
from photomaker.
I've done the fork -> spawn thing, but that still gives me an error
(venv) Q:\PhotoMaker>python gradio_demo/app.py
Traceback (most recent call last):
File "gradio_demo/app.py", line 17, in
from photomaker.pipeline import PhotoMakerStableDiffusionXLPipeline
ModuleNotFoundError: No module named 'photomaker.pipeline'
Will try moving the folder...
from photomaker.
Also changed the line of code from 'fork' to 'spawn' but I still get a similar ModuleNotFoundError
(venv-photomaker) C:\Users\USER\PhotoMaker>python gradio_demo/app.py Traceback (most recent call last): File "C:\Users\USER\PhotoMaker\gradio_demo\app.py", line 13, in <module> from photomaker.pipeline import PhotoMakerStableDiffusionXLPipeline ModuleNotFoundError: No module named 'photomaker'
from photomaker.
I had to install photomaker by "pip install photomaker"
to get past that error, but I still have error I just posted about ๐ค
from photomaker.
I had to install photomaker by "pip install photomaker" to get past that error, but I still have error I just posted about ๐ค
This won't work cuz it's another library you're installing, which is used to make funny pictures https://pypi.org/project/photomaker/
I just tried the following:
- in terminal type "Python" or "Python3"
- then paste the code to download the models from huggingface: from huggingface_hub import hf_hub_download
photomaker_path = hf_hub_download(repo_id="TencentARC/PhotoMaker", filename="photomaker-v1.bin", repo_type="model") - It's currently downloading so hope this fixes it
Edit: installing the models did not fix the ModuleNotFoundError: No Module named 'photomaker'
from photomaker.
I had to install photomaker by "pip install photomaker" to get past that error, but I still have error I just posted about ๐ค
This won't work cuz it's another library you're installing, which is used to make funny pictures https://pypi.org/project/photomaker/
I just tried the following:
* in terminal type "Python" or "Python3" * then paste the code to download the models from huggingface: from huggingface_hub import hf_hub_download photomaker_path = hf_hub_download(repo_id="TencentARC/PhotoMaker", filename="photomaker-v1.bin", repo_type="model") * It's currently downloading so hope this fixes it
Edit: installing the models did not fix the ModuleNotFoundError: No Module named 'photomaker'
try my solution -with all files into the gradient_demo folder, and adjusting the two .py files to not look into the photomaker studio as described above. it works for me until now - gotta wait for the download to finish
from photomaker.
Let us know if you get reasonable outputs. I followed the approach above and got Gradio running, but my outputs are a blobby brown noise.
from photomaker.
Allmost worked...
-
Change line 42 in
venv\Lib\site-packages\spaces\zero\wrappers.py
fromProcess = multiprocessing.get_context('fork').Process
toProcess = multiprocessing.get_context('spawn').Process
-
move the files in
photomaker-dir
togradio_demo
-
remove original photomaker-dir
-
Change line 22 in pipeline.py from
from photomaker.model import PhotoMakerIDEncoder
tofrom model import PhotoMakerIDEncoder
-
Change line 14 in app.py from
from photomaker.pipeline import PhotoMakerStableDiffusionXLPipeline
tofrom pipeline import PhotoMakerStableDiffusionXLPipeline
from photomaker.
E:\AI\Fooocus\PhotoMaker>.\python_embeded\python.exe -s PhotoMaker/app.py Traceback (most recent call last): File "E:\AI\Fooocus\PhotoMaker\PhotoMaker\app.py", line 10, in <module> import spaces File "E:\AI\Fooocus\PhotoMaker\python_embeded\lib\site-packages\spaces\__init__.py", line 10, in <module> from .zero.decorator import GPU File "E:\AI\Fooocus\PhotoMaker\python_embeded\lib\site-packages\spaces\zero\decorator.py", line 17, in <module> from . import client File "E:\AI\Fooocus\PhotoMaker\python_embeded\lib\site-packages\spaces\zero\client.py", line 17, in <module> from .gradio import get_event File "E:\AI\Fooocus\PhotoMaker\python_embeded\lib\site-packages\spaces\zero\gradio.py", line 8, in <module> from gradio.context import LocalContext ImportError: cannot import name 'LocalContext' from 'gradio.context' (E:\AI\Fooocus\PhotoMaker\python_embeded\lib\site-packages\gradio\context.py)
from photomaker.
@dancemanUK
Please ask, why I downloaded the file according to your screenshot, and there is no response after it can be run, why is this?
from photomaker.
Guys, you donโt need to be tricky, just put the file in the root and thatโs it, change the extension to .py
app1.txt
from photomaker.
and put the style file in the root too
from photomaker.
Guys, you donโt need to be tricky, just put the file in the root and thatโs it, change the extension to .py app1.txt
running on sagemaker i've got this
(photomaker) studio-lab-user@default:~/PhotoMaker$ python app1.py
Loading pipeline components...: 100%|โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ| 7/7 [00:40<00:00, 5.81s/it]
Loading PhotoMaker components [1] id_encoder from [/home/studio-lab-user/.cache/huggingface/hub/models--TencentARC--PhotoMaker/snapshots/3602d02ba7cc99ce8886e24063ed10e4f2510c84]...
Loading PhotoMaker components [2] lora_weights from [/home/studio-lab-user/.cache/huggingface/hub/models--TencentARC--PhotoMaker/snapshots/3602d02ba7cc99ce8886e24063ed10e4f2510c84]
Running on local URL: http://127.0.0.1:7860
2024/02/19 18:15:34 [W] [service.go:132] login to server failed: dial tcp 44.237.78.176:7000: i/o timeout
Could not create share link. Please check your internet connection or our status page: https://status.gradio.app.
from photomaker.
Related Issues (20)
- How add another Loras model? HOT 3
- An error occurred while running the app.py file HOT 2
- ๆฎ้ไบบ็ ง็ๆพไธๅปไธๅคชๅ HOT 4
- `class_word` in prompt
- Is there any plan to release the training code?
- ่ฏไบไธไธ,ๆ่ง่ชๅทฑๅฏนๆฏ็ ง็ๅไธไบๅฅฝๅค HOT 1
- ่พๅ ฅไธๅผ ๅพ็ไธญๅ ๅซๅคไธชไบบ่ธๆถ๏ผๅฆไฝๅค็๏ผ
- Progress stuck 0.0%
- PhotoMaker Style difference
- Any way to change the output path of the demo and not have all images disappear? HOT 1
- Support for ControlNet? HOT 1
- Gradio app.py examples
- Can the class word automatically detect during inference stage?
- Weighted prompt on photomaker
- Whatโs the weight license?
- httpx.RemoteProtocolError: Server disconnected without sending a response
- Can photomaker be used with SD XL Lightning?
- Why is it running slowly on an L4 GPU?
- Where to initialize self.id_image_processor?
- About the batch inference
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from photomaker.