Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert lora weights change and unavailable SD model #36

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 6 additions & 42 deletions inference/sagemaker/byos/stablediffusion_sagemaker_byos.zh.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,15 @@
},
"outputs": [],
"source": [
"#model_name = 'andite/anything-v4.0' # 默认的,高品质、高细节的动漫风格\n",
"model_name = 'andite/anything-v4.0' # 默认的,高品质、高细节的动漫风格\n",
"#model_name = 'Envvi/Inkpunk-Diffusion' # 温克朋克风格,提示词 nvinkpunk\n",
"#model_name = 'nousr/robo-diffusion-2-base' # 看起来很酷的机器人,提示词 nousr robot \n",
"#model_name = 'prompthero/openjourney' # openjorney 风格,提示词 mdjrny-v4 style\n",
"#model_name = 'dreamlike-art/dreamlike-photoreal-2.0' #写实,真实风格,提示词 photo\n",
"#model_name = 'runwayml/stable-diffusion-inpainting'\n",
"\n",
"#增加 SD Webui Lora 模型加载\n",
"model_name = 'sakistriker/AbyssOrangeMix3'\n",
"#model_name = 'sakistriker/AbyssOrangeMix3'\n",
"lora_model = 's3://sagemaker-us-east-1-596030579944/fakemonPokMonLORA/fakemonPokMonLORA_v10Beta.safetensors'\n",
"\n",
"\n",
Expand All @@ -147,7 +147,7 @@
" 'SAGEMAKER_MODEL_SERVER_TIMEOUT':'600', \n",
" 'SAGEMAKER_MODEL_SERVER_WORKERS': '1', \n",
" 'model_name':model_name,\n",
" 'lora_model':lora_model,\n",
" #'lora_model':lora_model,\n",
" 's3_bucket':bucket\n",
"}"
]
Expand Down Expand Up @@ -238,7 +238,7 @@
"import uuid\n",
"\n",
"endpoint_name = f'AIGC-Quick-Kit-{str(uuid.uuid4())}'\n",
"instance_type = 'ml.g4dn.xlarge'\n",
"instance_type = 'ml.g5.xlarge'\n",
"instance_count = 1\n",
"async_config = AsyncInferenceConfig(output_path='s3://{0}/{1}/asyncinvoke/out/'.format(bucket, 'stablediffusion'))\n",
"\n",
Expand Down Expand Up @@ -392,7 +392,8 @@
"source": [
"#AIGC Quick Kit txt2img\n",
"inputs_txt2img = {\n",
" \"prompt\": \"a photo of an astronaut riding a horse on mars\",\n",
" #\"prompt\": \"a photo of an astronaut riding a horse on mars\",\n",
" \"prompt\": \"a photo of robot standing in front a fire, cinematic style\",\n",
" \"negative_prompt\":\"\",\n",
" \"steps\":20,\n",
" \"sampler\":\"euler_a\",\n",
Expand Down Expand Up @@ -452,43 +453,6 @@
"async_predict_fn(async_predictor,inputs_img2img)"
]
},
{
"cell_type": "markdown",
"id": "d0877bea",
"metadata": {},
"source": [
"#### 3.2 LoRA 测试\n",
"测试LoRA 模型"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c350d596",
"metadata": {},
"outputs": [],
"source": [
"prompt =\"pokemon,fire, a red wolf with blue eyes\"\n",
"\n",
"\n",
"negative_prompt= \"nsfw, human, 1boy, 1girl,watermark, (worst quality, low quality:1.4), ( jpeg artifacts:1.4), (depth of field, bokeh, blurry, film grain, chromatic aberration, lens flare:1.0), greyscale, monochrome, dusty sunbeams, trembling, motion lines, motion blur, emphasis lines, text, title, logo, signature,\"\n",
"\n",
"inputs_txt2img = {\n",
" \"prompt\": prompt,\n",
" \"negative_prompt\":negative_prompt,\n",
" \"steps\":20,\n",
" \"sampler\":\"euler_a\",\n",
" \"seed\": 52362,\n",
" \"height\": 512, \n",
" \"width\": 512,\n",
" \"count\":2\n",
"\n",
"}\n",
"start=time.time()\n",
"async_predict_fn(async_predictor,inputs_txt2img)\n",
"print(f\"Time taken: {time.time() - start}s\")\n"
]
},
{
"cell_type": "markdown",
"id": "5af27f2f",
Expand Down