T2I-Adapter: Official Implementation Of T2I-Adapter

T2I-Adapter

Official implementation of T2I-Adapter: Learning Adapters to Dig out More Controllable Ability for Text-to-Image Diffusion Models.

Paper

We propose T2I-Adapter, a simple and small (~70M parameters, ~300M storage space) network that can provide extra guidance to pre-trained text-to-image models while freezing the original large text-to-image models.

T2I-Adapter aligns internal knowledge in T2I models with external control signals. We can train various adapters according to different conditions, and achieve rich control and editing effects.

⏬ Download Models

Put the downloaded models in the T2I-Adapter/models folder.

  1. The T2I-Adapters can be download from https://huggingface.co/TencentARC/T2I-Adapter.
  2. The pretrained Stable Diffusion v1.4 models can be download from https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/tree/main. You need to download the sd-v1-4.ckpt file.
  3. [Optional] If you want to use Anything v4.0 models, you can download the pretrained models from https://huggingface.co/andite/anything-v4.0/tree/main. You need to download the anything-v4.0-pruned.ckpt file.
  4. The pretrained clip-vit-large-patch14 folder can be download from https://huggingface.co/openai/clip-vit-large-patch14/tree/main. Remember to download the whole folder!
  5. The pretrained keypose detection models include FasterRCNN (human detection) from https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth and HRNet (pose detection) from https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w48_coco_256x192-b9e0b3ab_20200708.pth.

After downloading, the folder structure should be like this:

🔧 Dependencies and Installation

pip install -r requirements.txt

💻 How to Test

  • The results are in the experiments folder.
  • If you want to use the Anything v4.0, please add --ckpt models/anything-v4.0-pruned.ckpt in the following commands.

Sketch Adapter

  • Sketch to Image Generation

python test_sketch.py --plms --auto_resume --prompt "A car with flying wings" --path_cond examples/sketch/car.png --ckpt models/sd-v1-4.ckpt --type_in sketch

  • Image to Image Generation

python test_sketch.py --plms --auto_resume --prompt "A beautiful girl" --path_cond examples/anything_sketch/human.png --ckpt models/sd-v1-4.ckpt --type_in image

  • Generation with Anything setting

python test_sketch.py --plms --auto_resume --prompt "A beautiful girl" --path_cond examples/anything_sketch/human.png --ckpt models/anything-v4.0-pruned.ckpt --type_in image

Gradio Demo

You can use gradio to experience all these three functions at once. CPU is also supported by setting device to 'cpu'.

python gradio_sketch.py

Keypose Adapter

  • Keypose to Image Generation

python test_keypose.py --plms --auto_resume --prompt "A beautiful girl" --path_cond examples/keypose/iron.png --type_in pose

  • Image to Image Generation

python test_keypose.py --plms --auto_resume --prompt "A beautiful girl" --path_cond examples/sketch/human.png --type_in image

  • Generation with Anything setting

python test_keypose.py --plms --auto_resume --prompt "A beautiful girl" --path_cond examples/sketch/human.png --ckpt models/anything-v4.0-pruned.ckpt --type_in image

Gradio Demo

You can use gradio to experience all these three functions at once. CPU is also supported by setting device to 'cpu'.

python gradio_keypose.py

Segmentation Adapter

python test_seg.py --plms --auto_resume --prompt "A black Honda motorcycle parked in front of a garage" --path_cond examples/seg/motor.png

Two adapters: Segmentation and Sketch Adapters

python test_seg_sketch.py --plms --auto_resume --prompt "An all white kitchen with an electric stovetop" --path_cond examples/seg_sketch/mask.png --path_cond2 examples/seg_sketch/edge.png

Local editing with adapters

python test_sketch_edit.py --plms --auto_resume --prompt "A white cat" --path_cond examples/edit_cat/edge_2.png --path_x0 examples/edit_cat/im.png --path_mask examples/edit_cat/mask.png

Stable Diffusion + T2I-Adapters (only ~70M parameters, ~300M storage space)

The following is the detailed structure of a Stable Diffusion model with the T2I-Adapter.

🚀 Interesting Applications

Stable Diffusion results guided with the sketch T2I-Adapter

The corresponding edge maps are predicted by PiDiNet. The sketch T2I-Adapter can well generalize to other similar sketch types, for example, sketches from the Internet and user scribbles.

Stable Diffusion results guided with the keypose T2I-Adapter

The keypose results predicted by the MMPose. With the keypose guidance, the keypose T2I-Adapter can also help to generate animals with the same keypose, for example, pandas and tigers.

T2I-Adapter with Anything-v4.0

Once the T2I-Adapter is trained, it can act as a plug-and-play module and can be seamlessly integrated into the finetuned diffusion models without re-training, for example, Anything-4.0.

✨ Anything results with the plug-and-play sketch T2I-Adapter (no extra training)

Anything results with the plug-and-play keypose T2I-Adapter (no extra training)

Local editing with the sketch adapter

When combined with the inpaiting mode of Stable Diffusion, we can realize local editing with user specific guidance.

✨ Change the head direction of the cat

✨ Add rabbit ears on the head of the Iron Man.

Combine different concepts with adapter

Adapter can be used to enhance the SD ability to combine different concepts.

✨ A car with flying wings. / A doll in the shape of letter ‘A’.

Sequential editing with the sketch adapter

We can realize the sequential editing with the adapter guidance.

Composable Guidance with multiple adapters

Stable Diffusion results guided with the segmentation and sketch adapters together.

Logo materials: adapter, lightbulb


Download Models | 💻How to Test


Download Details:

Author: TencentARC
Source Code: https://github.com/TencentARC/T2I-Adapter 
License: Apache-2.0 license

#python #text #image 

What is GEEK

Buddha Community

T2I-Adapter: Official Implementation Of T2I-Adapter

T2I-Adapter: Official Implementation Of T2I-Adapter

T2I-Adapter

Official implementation of T2I-Adapter: Learning Adapters to Dig out More Controllable Ability for Text-to-Image Diffusion Models.

Paper

We propose T2I-Adapter, a simple and small (~70M parameters, ~300M storage space) network that can provide extra guidance to pre-trained text-to-image models while freezing the original large text-to-image models.

T2I-Adapter aligns internal knowledge in T2I models with external control signals. We can train various adapters according to different conditions, and achieve rich control and editing effects.

⏬ Download Models

Put the downloaded models in the T2I-Adapter/models folder.

  1. The T2I-Adapters can be download from https://huggingface.co/TencentARC/T2I-Adapter.
  2. The pretrained Stable Diffusion v1.4 models can be download from https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/tree/main. You need to download the sd-v1-4.ckpt file.
  3. [Optional] If you want to use Anything v4.0 models, you can download the pretrained models from https://huggingface.co/andite/anything-v4.0/tree/main. You need to download the anything-v4.0-pruned.ckpt file.
  4. The pretrained clip-vit-large-patch14 folder can be download from https://huggingface.co/openai/clip-vit-large-patch14/tree/main. Remember to download the whole folder!
  5. The pretrained keypose detection models include FasterRCNN (human detection) from https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r50_fpn_1x_coco/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth and HRNet (pose detection) from https://download.openmmlab.com/mmpose/top_down/hrnet/hrnet_w48_coco_256x192-b9e0b3ab_20200708.pth.

After downloading, the folder structure should be like this:

🔧 Dependencies and Installation

pip install -r requirements.txt

💻 How to Test

  • The results are in the experiments folder.
  • If you want to use the Anything v4.0, please add --ckpt models/anything-v4.0-pruned.ckpt in the following commands.

Sketch Adapter

  • Sketch to Image Generation

python test_sketch.py --plms --auto_resume --prompt "A car with flying wings" --path_cond examples/sketch/car.png --ckpt models/sd-v1-4.ckpt --type_in sketch

  • Image to Image Generation

python test_sketch.py --plms --auto_resume --prompt "A beautiful girl" --path_cond examples/anything_sketch/human.png --ckpt models/sd-v1-4.ckpt --type_in image

  • Generation with Anything setting

python test_sketch.py --plms --auto_resume --prompt "A beautiful girl" --path_cond examples/anything_sketch/human.png --ckpt models/anything-v4.0-pruned.ckpt --type_in image

Gradio Demo

You can use gradio to experience all these three functions at once. CPU is also supported by setting device to 'cpu'.

python gradio_sketch.py

Keypose Adapter

  • Keypose to Image Generation

python test_keypose.py --plms --auto_resume --prompt "A beautiful girl" --path_cond examples/keypose/iron.png --type_in pose

  • Image to Image Generation

python test_keypose.py --plms --auto_resume --prompt "A beautiful girl" --path_cond examples/sketch/human.png --type_in image

  • Generation with Anything setting

python test_keypose.py --plms --auto_resume --prompt "A beautiful girl" --path_cond examples/sketch/human.png --ckpt models/anything-v4.0-pruned.ckpt --type_in image

Gradio Demo

You can use gradio to experience all these three functions at once. CPU is also supported by setting device to 'cpu'.

python gradio_keypose.py

Segmentation Adapter

python test_seg.py --plms --auto_resume --prompt "A black Honda motorcycle parked in front of a garage" --path_cond examples/seg/motor.png

Two adapters: Segmentation and Sketch Adapters

python test_seg_sketch.py --plms --auto_resume --prompt "An all white kitchen with an electric stovetop" --path_cond examples/seg_sketch/mask.png --path_cond2 examples/seg_sketch/edge.png

Local editing with adapters

python test_sketch_edit.py --plms --auto_resume --prompt "A white cat" --path_cond examples/edit_cat/edge_2.png --path_x0 examples/edit_cat/im.png --path_mask examples/edit_cat/mask.png

Stable Diffusion + T2I-Adapters (only ~70M parameters, ~300M storage space)

The following is the detailed structure of a Stable Diffusion model with the T2I-Adapter.

🚀 Interesting Applications

Stable Diffusion results guided with the sketch T2I-Adapter

The corresponding edge maps are predicted by PiDiNet. The sketch T2I-Adapter can well generalize to other similar sketch types, for example, sketches from the Internet and user scribbles.

Stable Diffusion results guided with the keypose T2I-Adapter

The keypose results predicted by the MMPose. With the keypose guidance, the keypose T2I-Adapter can also help to generate animals with the same keypose, for example, pandas and tigers.

T2I-Adapter with Anything-v4.0

Once the T2I-Adapter is trained, it can act as a plug-and-play module and can be seamlessly integrated into the finetuned diffusion models without re-training, for example, Anything-4.0.

✨ Anything results with the plug-and-play sketch T2I-Adapter (no extra training)

Anything results with the plug-and-play keypose T2I-Adapter (no extra training)

Local editing with the sketch adapter

When combined with the inpaiting mode of Stable Diffusion, we can realize local editing with user specific guidance.

✨ Change the head direction of the cat

✨ Add rabbit ears on the head of the Iron Man.

Combine different concepts with adapter

Adapter can be used to enhance the SD ability to combine different concepts.

✨ A car with flying wings. / A doll in the shape of letter ‘A’.

Sequential editing with the sketch adapter

We can realize the sequential editing with the adapter guidance.

Composable Guidance with multiple adapters

Stable Diffusion results guided with the segmentation and sketch adapters together.

Logo materials: adapter, lightbulb


Download Models | 💻How to Test


Download Details:

Author: TencentARC
Source Code: https://github.com/TencentARC/T2I-Adapter 
License: Apache-2.0 license

#python #text #image 

David Johnson

1614244987

Ovidis | Easy Wear Adaptive Clothing for Seniors, Elderly & Disabled

Getting dressed and undressed is a regular activity that can sometimes be difficult for seniors. But if they are suffering from arthritis pain, this normal activity can become one of the most challenging ones for them. No matter what form of arthritis they have, no pain should make them lose their independence. For that reason, we have put together a list of some simple dressing tips that can make dressing significantly easier for seniors with arthritis pain. Let us take a look at them.

This is image title

  1. Avoid tight clothes
    Avoid choosing tighter clothes for your aging loved one with arthritis, especially if their range of motion is restricted by arthritis. Loose fit clothes can be easy to get into and take off, for that reason, choose clothes that are one size large from their usual size. You can also consider adaptive pants for seniors as they are easy to wear. This way, when they are having a tough day, they can easily take on and off these clothes without taking much help from other people.

  2. Choose simple clothing
    If your aging loved one is suffering from arthritis pain in their hands, operating zippers and small buttons can make dressing more difficult. The fasting of their clothing plays a major role in their dressing style. For that reason, it is better to choose adaptive clothing as it is specifically made for people with mobility issues. You can pick adaptive pants and sweaters for them as they do not have zippers but elastic, which makes dressing up and down much easier for your loved one with arthritis.

  3. Add a metal ring
    Clothes that come with zippers tend to be difficult to wear. Most clothes have a small ring that looks quite classy but for a senior with arthritis, the same zipper can become a nightmare for them as it may get difficult for them to hold the small zipper. For that reason, the best way to reduce their stress is to add a metal ring to the opening or you can also attach a long ribbon. This will make it easier for them to grasp and pull the zipper.

  4. Choose clothes with magnet or velcro closing
    Since buttons and zippers can make dressing challenging for your aging loved one, choosing clothes with magnets or velcro closing could be a great idea. This way, they won’t have to struggle and enjoy their independence. You can also consider buying adaptive pants for disabled seniors.
    Arthritis pain can put a lot of strain on the physical as well as mental health of your loved one. Losing independence is one such thing that everyone loses. For that reason, choosing adaptive clothing for handicapped people can be the best course of action to take.

Author’s Bio – The author is a blogger. This article is about dressing tips for seniors with arthritis pain.

#adaptive pants for seniors #adaptive pants for disabled #adaptive clothing for handicapped

Alex Tyler

Alex Tyler

1597386039

How to Use the Official NGINX Docker Image

NGINX is one of the most popular web servers in the world. Not only is NGINX a fast and reliable static web server, it is also used by a ton of developers as a reverse-proxy that sits in front of their APIs.

In this tutorial we will take a look at the NGINX Official Docker Image and how to use it. We’ll start by running a static web server locally then we’ll build a custom image to house our web server and the files it needs to serve. We’ll finish up by taking a look at creating a reverse-proxy server for a simple REST API and then how to share this image with your team.

Prerequisites

To complete this tutorial, you will need the following:

  • Free Docker Account
  • You can  sign-up for a free Docker account and receive free unlimited public repositories
  • Docker running locally
  • Instructions to download and install Docker
  • An IDE or text editor to use for editing files. I would recommend  VSCode

#docker official images #nginx #official image

Coolgear Inc

Coolgear Inc

1614244787

USB to Serial RS232 Adapters

USB to RS232 Serial adapters in Plastic, Cable, and Metal Chassis construction with LED Status Indicators and DB9 Male Ports and Terminal Wire Connections.

#usb to rs232 adapter #serial rs232 adapter

Ahebwe  Oscar

Ahebwe Oscar

1624067081

REST Implementation Of Django Authentication System for Python

djoser

REST implementation of Django authentication system. djoser library provides a set of Django Rest Framework views to handle basic actions such as registration, login, logout, password reset and account activation. It works with custom user model.

Instead of reusing Django code (e.g. PasswordResetForm), we reimplemented few things to fit better into Single Page App architecture.

Developed by SUNSCRAPERS with passion & patience.

Requirements

To be able to run djoser you have to meet following requirements:

  • Python (3.6, 3.7, 3.8, 3.9)
  • Django (2.2, 3.1)
  • Django REST Framework 3.11.1

If you need to support other versions, please use djoser<2.

Installation

Simply install using pip:

$ pip install djoser

And continue with the steps described at configuration guide.

#django #authentication #rest implementation of django authentication system for python #rest #django authentication system for python #rest implementation