Argo CD Declarative GitOps CD for Kubernetes E2E Networks documentation Skip to content E2E Cloud Docs E2E Networks TIR Toggle navigation menu Login Sign Up E2E Networks documentation K Docs E2E Networks TIR Myaccount Getting Started with Myaccount SignUp Process for Indian Customers Customer validation Process for Indian Customers SignUp Process for International Customers Customer Validation Process for International Process Customer Validation Process for Contact Persons Domestic Customer Validation Process FAQs International Customer Validation Process FAQs Sign In Process Release Notes Compute Nodes Virtual Compute Nodes Monitoring 1Click Deployment Active Directory GPU GPU Cloud EQS Introduction How to Create EQS Actions Add Queue under tab Actions for queue service Using SDK Appliance Load Balancer Appliance Auto Scaling Introduction Concepts Define Scale Groups FaaS Function as a Service FaaS How to Create Functions Functions Information Network CDN VPC How to reserve an IP address Reserve IP Pool DNS Custom Reverse DNS Firewall Security Group Tag Security Firewall Bitninja Best Practices SSH Key Management Audit Logs Password Policy 2Factor Authentication Others License Management User Management Purchase SSL CertbotPlugin Apply or Redeem Coupon Code Account Statement Cloud Platform Support Introduction Platform Support Policy FAQ E2Es MyAccount FAQs Code of Conduct of Directors and Senior Management CSR Policy Whistle blower policy Jitsi Meet Mod Evasive Multisite using cPanel Softaculous Copying data from Linux to Windows using WinSCP Migrate MySQL Database Between DBaaS Manage MySQL Abuse Abuse Logs Abuse Attacks Spam Mails Phishing Complaint Copyright Complaint Billing Payment Payment Method EMandate Redeem Coupon Customer Details Updation Setup AutoDebit feature TDS Deduction process Declaration us 206AB Minimum Billing Provisioning and Deprovisioning Process View Invoice and Payment Prepaid Billing Set up Infra Credits Balance Alert Whatsapp notification for Payment reminder Restore Service on a Suspended Account for NonPayment Database Database Database PostgreSQL Parameter Group How to create Parameter Group MongoDB mariaDB Storage Storage Block Storage Object Storage CDP Backup Scalable File System Kubernetes Kubernetes Service Kubernetes Kubernetes Marketplace Monitoring Stack Cert Manager Nginx Ingress Controller Troubleshooting Argo CD Declarative GitOps CD for Kubernetes Deploy to Kubernetes using Argo CD and GitOps Jenkins CI Tool Setup Jenkins On Kubernetes Cluster Ansible CD Tool Istio Service Connecting to Dbaas FAQS Container Registery Container Registry Simplifying Pull Operations with UserFriendly Interface API Developers Guide API SDK E2E CLI Tool Introduction Terraform Terraform Getting Started e2enode Resource Node Plans e2eimage Resource AIML TIR AI Release Notes TIR AI Platform Introduction Getting Started Howto Guides Projects Notebooks Committed Notebook GPU H100 Plans Datasets Model Repository Model Endpoints Pipeline Run Scheduled Run Fine Tuning Models Model Playground Samples and Tutorials API Tokens SSH Key Container Team Features Settings Analytics Billing AIML Tutorials Finetune LLMA with Multiple GPUs Deploy Inference for LLMA 2 Deploy Inference for Codellama Deploy Inference for Stable Diffusion v21 Finetune Stable Diffusion model on TIR Deploy Inference for MPT7BCHAT Custom Containers in TIR Fine Tuning Bloom Natural Language Queries to SQL wth Code Llama E2E Networks documentation E2E Networks Kubernetes Service Argo CD Declarative GitOps CD for Kubernetes Argo CD Declarative GitOps CD for Kubernetes Introducing Argo CD Declarative Continuous Delivery for Kubernetes Argo project Argo workflows is an opensource containernative workflow engine for Kubernetes The project is widely for simple CICD pipelines to DAGbased machine learning and data analytics workflows and is growing faster than ever We also have worked out with sample Agro Events to provide an eventbased dependency manager for automatically triggering Argo workflows and other actions in Kubernetes We are thrilled to announce Argo CD is a new Kubernetesnative opensource project brought to you by the Argo community and Intuit to provide a declarative continuous delivery CD system Argo CD supports a variety of configuration management tools includingksonnetjsonnet and Helm Why Argo CD Argo CD extends the benefits of declarative specifications and Gitbased configuration management to accelerate the deployment and lifecycle management of applications without compromising security and compliance The fundamental requirements for Argo CD are Application deployment and lifecycle management should be simple automated and auditable Application deployments should be fast reliable and idempotent Any deviation from the versioncontrolled configuration should be immediately detected and remediated Rollbacks should be as simple as deploying a different configuration Intuit started the Argo CD project to address a need for a fast reliable continuous delivery service for deploying hundreds of microservices across a fleet of Kubernetes clusters using Git as the source of truth for not only application source code but for application and environmental deployment configurations Argo CD is the first step in achieving continuous operations based on monitoring analytics and automated remediation of operational problems based on declarative specifications and automated learning and automated categorization of system behavior We examined many existing solutions such as Spinnaker but found that they did not meet our needs Declarative Kubernetes YAMLs ksonnetjsonnet Helm customize Kubernetesnative Git as the source of truth GitOps Clear separation between CICd continuous integrationdelivery and continuous deployment CD processes Enterprisefriendly auditability compliance security RBAC SSO How does Argo CD work Argo CD uses git repositories as the source of truth for the desired state of applications and the target deployment environments Kubernetes manifests can be specified as YAML files ksonnetjsonnet applications or Helm packages Argo CD automates the synchronization of the desired application state with each of the specified target environments Here is a highlevel architectural view CRD which continuously monitors running applications and compares the current live state against the desired target state as specified in the git repo A deployed application whose live state deviates from its target state is considered outofsync Argo CD reports visualizes any deviation as well as provides mechanisms to automatically or manually sync the live state to the desired target state Any modifications made to the desired target state in the git repo can be automatically applied and reflected in the specified target environments You can get started in 2 easy steps Define your App and environment configs in a Git repo Argo monitors and syncs your app between Git config and the Kubernetes cluster using any pipeline Argo CI Jenkins etc CLI or UI Pull or push There are a couple of different ways of doing declarative continuous delivery Pull model is where the CD system Argo CD continuously monitors and updates the applications state on the Kubernetes cluster to the target state defined in Git In the push model a user initiates the update from an external system using a CI pipeline Argo CD supports both the pull and the pushbased GitOps model to sync target environments with desired application states At Intuit we follow the push model and invoke Argo CD from a CD pipeline Jenkins for security and compliance reasons Argo CD features Syncing of applications to their desired state as defined in Git using variety of configuration management tools such as ksonnetjsonnet Helm and customize Automated deployment of applications to specified target environments Continuous monitoring of deployed applications Web and CLIbased visualization of applications and differences between current and target states RollbackRollanywhere to any application state committed in the git repository PreSync Sync and PostSync hooks to support complex application rollouts egbluegreen canary upgrades SSO Integration OIDC LDAP SAML 20 GitLab Microsoft LinkedIn Webhook integration GitHub BitBucket GitLab Can be used standalone or as part of existing pipeline tools such as Argo Workflow Jenkins etc Future support for Kubernetes Application CRD once it is released Deploy to Kubernetes using Argo CD and GitOps Requirements Installed kubectl commandline tool Have a kubeconfig file default location is kubeconfig CoreDNS Can be enabled for microk8s by microk8s enable dns microk8s stop microk8s start kubectl create namespace argocd kubectl apply n argocd f httpsrawgithubusercontentcomargoprojargocdstablemanifestsinstallyaml This will create a new namespace argocd where Argo CD services and application resources will live If you are not interested in UI SSO multicluster features then you can install core Argo CD components only kubectl create namespace argocd kubectl apply n argocd f httpsrawgithubusercontentcomargoprojargocdstablemanifestscoreinstallyaml This default installation will have a selfsigned certificate and cannot be accessed without a bit of extra work Do one of Follow the instructions to configure a certificate and ensure that the client OS trusts it Configure the client OS to trust the self signed certificate Use the insecure flag on all Argo CD CLI operations in this guide Use argocd login core to configure CLI access and skip steps 35 Download the latest Argo CD version from httpsgithubcomargoprojargocdreleaseslatest More detailed installation instructions can be found via the CLI installation documentation Also available in Mac Linux and WSL Homebrew brew install argocd By default the Argo CD API server is not exposed with an external IP To access the API server choose one of the following techniques to expose the Argo CD API server Service Type Load Balancer Change the argocdserver service type to LoadBalancer kubectl patch svc argocdserver n argocd p spec type LoadBalancer Ingress Follow the ingress documentation on how to configure Argo CD with ingress Port Forwarding Kubectl portforwarding can also be used to connect to the API server without exposing the service kubectl portforward svcargocdserver n argocd 8080443 The API server can then be accessed using httpslocalhost8080 Login Using The CLI The initial password for the admin account is autogenerated and stored as clear text in the field password in a secret named argocdinitialadminsecret in your Argo CD installation namespace You can simply retrieve this password using kubectl kubectl n argocd get secret argocdinitialadminsecret o jsonpathdatapassword base64 d echo Using the username admin and the password from above log in to Argo CDs IP or hostname argocd login ARGOCDSERVER Change the password using the command argocd account updatepassword This step registers a clusters credentials to Argo CD and is only necessary when deploying to an external cluster When deploying internally to the same cluster that Argo CD is running in httpskubernetesdefaultsvc should be used as the applications K8s API server address First list all clusters contexts in your current kubeconfig kubectl config getcontexts o name Choose a context name from the list and supply it to argocd cluster add CONTEXTNAME For example for dockerdesktop context run argocd cluster add dockerdesktop The above command installs a ServiceAccount argocdmanager into the kubesystem namespace of that kubectl context and binds the service account to an adminlevel ClusterRole Argo CD uses this service account token to perform its management tasks ie deploymonitoring Note The rules of the argocdmanagerrole role can be modified such that it only has create update patch delete privileges to a limited set of namespaces groups kinds However get list watch privileges are required at the clusterscope for Argo CD to function An example repository containing a guestbook application is available at httpsgithubcomargoprojargocdexampleappsgit to demonstrate how Argo CD works Creating Apps Via CLI First we need to set the current namespace to argocd running the following command kubectl config setcontext current namespaceargocd Create the example guestbook application with the following command argocd app create guestbook repo httpsgithubcomargoprojargocdexampleappsgit path guestbook destserver httpskubernetesdefaultsvc destnamespace default How to create applications Using UserInterface Open a browser to the Argo CD external UI and login by visiting the IPhostname in a browser and use the credentials set in step 4 Login into the ArgoCD server The password for admin is stored in secret with the name argocdinitialadminsecret and also decodes the password kubectl get secrets n argocd argocdinitialadminsecret o yaml echo ZVF1ZHVZU21OR1RqTFViWg base64 decode Copy this password and paste it into the UI and ignore the sign Now Sign In Currently it is empty Lets start creating applications Firstly through UI Click on NEW APP and fill in the details like application name demo project default sync policy manual repository URL where your application is present path in which the YAML files are located cluster URL select the cluster URL you are using namespace default Leave the rest of the spaces empty for the time being Our application is created Moreover for this outofsync status we have to enable the autosync policy which is present inside the APP DETAILS by clicking on this demo application The status of our application is now HEALTHY So this is the first way of creating the application through UI Lets create the application using CLI For the CLI first we have to install the argocd binary wget httpsgithubcomargoprojargocdreleasesdownloadv242argocdlinuxamd64 Change the name of the binaryoptional mv argocdlinuxamd64 argocd Change permissions chmod x argocd Move this file to another directory sudo mv argocd usrlocalbin Now type argocd help to check the available commands Login to the server using your cluster IP and the port in my case the service is LoadBalancer so I am using the ExternalIP argocd login externalip Provide the same username and password that you used for the UI login Now lets create the application Therefore I am using the same example that I have used in the UI demo but with the different application name argocd app create appname project name repo git repo URL path app folder destnamespace namespace destserver server URL argocd app create demo1 project default repo httpsgithubcomJasmineHaritgitopscertificationexamplesgit path simpleapp destnamespace default destserver httpskubernetesdefaultsvc KEY POINTS appname is the name you want to give your applike demo1 project is the name of the project created or default app folder the path to the configuration for the application in the repository git repo it is the URL of the git repository where the configuration file is located destnamespace the name of the target namespace in the cluster where the application is deployed server URL use httpskubernetesdefaultsvc to reference the same cluster where ArgoCD has been deployed Now lets check the list of apps and the information of a particular app argocd app list argocd app get appname argocd app get demo1 So this is how you can create applications using CLI Another way to create applications is by writing a YAML file I am going to use the Gitlab example for this demo Clone the repository and Create a YAML file as below mentioned apiVersion argoprojiov1alpha1 kind Application metadata name argoapplication namespace argocd spec project default source repoURL httpsgitlabcomurlargocdappconfiggit targetRevision HEAD path dev destination server httpskubernetesdefaultsvc namespace myapp syncPolicy syncOptions CreateNamespacetrue automated selfHeal true prune true Points to remember Inside automated there are two things selfHeal is used for when you make changes directly to the cluster so argocd will automatically detect it and prune is used for when you remove or delete files from your repository that also argo will detect Now apply this YAML using below mentioned kubectl apply f yaml file name kubectl apply f applicationyaml Our application is created successfully On this page Introducing Argo CD Declarative Continuous Delivery for Kubernetes Why Argo CD How does Argo CD work Pull or push Argo CD features Deploy to Kubernetes using Argo CD and GitOps How to create applications Using UserInterface Login into the ArgoCD server Lets start creating applications Firstly through UI Lets create the application using CLI KEY POINTS Another way to create applications is by writing a YAML file Products TIR AI Platform GPU Dedicated Compute CPU Intensive Cloud High Memory Cloud Linux Smart Dedicated cPanel Linux Cloud Windows Cloud Windows SQL Cloud Plesk Windows Cloud GPU Smart Dedicated Load Balancer Company About Us Meet the Team Become a Partner E2E in Media Testimonials Investors Careers Contact Us Contact Sales Escalation Matrix Service Level Agreement Terms of Service Privacy Policy Refund Policy Policy FAQ Resources Blog Events Service Health Status Help White Papers Ecosystem Enablers Customers Certifications Countries Served FAQs E2E Networks Limited E2E Networks Limited is a NSE Listed AIFirst Hyperscale Cloud Computing Platform CIN Number L72900DL2009PLC341980 Copyright 2023 E2E Networks Limited


Prepaid Billing E2E Networks documentation Skip to content E2E Cloud Docs E2E Networks TIR Toggle navigation menu Login Sign Up E2E Networks documentation K Docs E2E Networks TIR Myaccount Getting Started with Myaccount SignUp Process for Indian Customers Customer validation Process for Indian Customers SignUp Process for International Customers Customer Validation Process for International Process Customer Validation Process for Contact Persons Domestic Customer Validation Process FAQs International Customer Validation Process FAQs Sign In Process Release Notes Compute Nodes Virtual Compute Nodes Monitoring 1Click Deployment Active Directory GPU GPU Cloud EQS Introduction How to Create EQS Actions Add Queue under tab Actions for queue service Using SDK Appliance Load Balancer Appliance Auto Scaling Introduction Concepts Define Scale Groups FaaS Function as a Service FaaS How to Create Functions Functions Information Network CDN VPC How to reserve an IP address Reserve IP Pool DNS Custom Reverse DNS Firewall Security Group Tag Security Firewall Bitninja Best Practices SSH Key Management Audit Logs Password Policy 2Factor Authentication Others License Management User Management Purchase SSL CertbotPlugin Apply or Redeem Coupon Code Account Statement Cloud Platform Support Introduction Platform Support Policy FAQ E2Es MyAccount FAQs Code of Conduct of Directors and Senior Management CSR Policy Whistle blower policy Jitsi Meet Mod Evasive Multisite using cPanel Softaculous Copying data from Linux to Windows using WinSCP Migrate MySQL Database Between DBaaS Manage MySQL Abuse Abuse Logs Abuse Attacks Spam Mails Phishing Complaint Copyright Complaint Billing Payment Payment Method EMandate Redeem Coupon Customer Details Updation Setup AutoDebit feature TDS Deduction process Declaration us 206AB Minimum Billing Provisioning and Deprovisioning Process View Invoice and Payment Prepaid Billing Set up Infra Credits Balance Alert Whatsapp notification for Payment reminder Restore Service on a Suspended Account for NonPayment Database Database Database PostgreSQL Parameter Group How to create Parameter Group MongoDB mariaDB Storage Storage Block Storage Object Storage CDP Backup Scalable File System Kubernetes Kubernetes Service Kubernetes Kubernetes Marketplace Monitoring Stack Cert Manager Nginx Ingress Controller Troubleshooting Argo CD Declarative GitOps CD for Kubernetes Deploy to Kubernetes using Argo CD and GitOps Jenkins CI Tool Setup Jenkins On Kubernetes Cluster Ansible CD Tool Istio Service Connecting to Dbaas FAQS Container Registery Container Registry Simplifying Pull Operations with UserFriendly Interface API Developers Guide API SDK E2E CLI Tool Introduction Terraform Terraform Getting Started e2enode Resource Node Plans e2eimage Resource AIML TIR AI Release Notes TIR AI Platform Introduction Getting Started Howto Guides Projects Notebooks Committed Notebook GPU H100 Plans Datasets Model Repository Model Endpoints Pipeline Run Scheduled Run Fine Tuning Models Model Playground Samples and Tutorials API Tokens SSH Key Container Team Features Settings Analytics Billing AIML Tutorials Finetune LLMA with Multiple GPUs Deploy Inference for LLMA 2 Deploy Inference for Codellama Deploy Inference for Stable Diffusion v21 Finetune Stable Diffusion model on TIR Deploy Inference for MPT7BCHAT Custom Containers in TIR Fine Tuning Bloom Natural Language Queries to SQL wth Code Llama E2E Networks documentation E2E Networks Billing and Payment Information Prepaid Billing Prepaid Billing E2E Networks has introduced a new Prepaid Billing System The benefit of prepaid billing is that you can pay as you go and you can be in complete control of your spending The prepaid billing system is available on the MyAccount portal and is applicable to all new customers and for existing customers who wish to opt for prepaid billing Getting Started To start using E2E products after choosing prepaid billing a customer should purchase Infra Credits Applicable GST is levied at the time of purchase You are free to topup the amount at any time with any amount The billing on E2E MyAccount is calculated on an hourly basis As soon as an hour finishes the relevant amount is deducted from the Infra Credits available However any details regarding the deduction of Infra Credits are only updated once in a day Suspension and Termination of Services Please keep your account adequately funded with Infra Credits Otherwise when you have overspent the Infra Credits the balance goes to negative Youll receive email alerts as soon as your Infra Credit balance turns negative For this reason it is important to add billingsupporte2enetworkscom to your contact list so that youll get all the billing updates directly into your email inbox While your Infra Credit balance is negative youll receive email alerts reminding you to topup Infra Credits You cant launch any new servicesservers when Infra Credits balance is negative If you do not pay the dues within 5 days your account is automatically suspended After another 5 days all your resources will be deletedterminated Please note that once the termination is done recovering any data is impossible However if you pay the dues and topup your account when the account was in a suspended state all the services will resume automatically Infra Credits There is no limit on how many Infra Credits one can purchase However these credits are nonrefundable nontransferable from one account to another Invoices As soon as you have purchased Infra Credits an invoice is generated and sent to your registered email address You can also see your history of invoices through Signed Invoices option available under Payment Methods Account Statement An invoice only gives details about how many credits you have purchased Through the Account Statement feature you can see how you have spent Infra Credits and which resources you have utilized The account statement is available on the Dashboard under Payment Methods Prepaid Billing FAQ Can I opt for TDS Tax Deduction at Source Yes you can opt for TDS When you create an account youll have an option to opt for TDS You can either choose to deduct 2 or 10 as TDS The Infra credit equivalent to the TDS amount will be on hold After you submit the TDS certificate our team will unhold the Infra Credits I have received a coupon will that expire The Coupon Code will have an expiry date However if you apply the coupon code to your account the Infra Credits will be added to your account immediately On this page Getting Started Suspension and Termination of Services Infra Credits Invoices Account Statement Prepaid Billing FAQ Can I opt for TDS Tax Deduction at Source I have received a coupon will that expire Products TIR AI Platform GPU Dedicated Compute CPU Intensive Cloud High Memory Cloud Linux Smart Dedicated cPanel Linux Cloud Windows Cloud Windows SQL Cloud Plesk Windows Cloud GPU Smart Dedicated Load Balancer Company About Us Meet the Team Become a Partner E2E in Media Testimonials Investors Careers Contact Us Contact Sales Escalation Matrix Service Level Agreement Terms of Service Privacy Policy Refund Policy Policy FAQ Resources Blog Events Service Health Status Help White Papers Ecosystem Enablers Customers Certifications Countries Served FAQs E2E Networks Limited E2E Networks Limited is a NSE Listed AIFirst Hyperscale Cloud Computing Platform CIN Number L72900DL2009PLC341980 Copyright 2023 E2E Networks Limited


What is Istio E2E Networks documentation Skip to content E2E Cloud Docs E2E Networks TIR Toggle navigation menu Login Sign Up E2E Networks documentation K Docs E2E Networks TIR Myaccount Getting Started with Myaccount SignUp Process for Indian Customers Customer validation Process for Indian Customers SignUp Process for International Customers Customer Validation Process for International Process Customer Validation Process for Contact Persons Domestic Customer Validation Process FAQs International Customer Validation Process FAQs Sign In Process Release Notes Compute Nodes Virtual Compute Nodes Monitoring 1Click Deployment Active Directory GPU GPU Cloud EQS Introduction How to Create EQS Actions Add Queue under tab Actions for queue service Using SDK Appliance Load Balancer Appliance Auto Scaling Introduction Concepts Define Scale Groups FaaS Function as a Service FaaS How to Create Functions Functions Information Network CDN VPC How to reserve an IP address Reserve IP Pool DNS Custom Reverse DNS Firewall Security Group Tag Security Firewall Bitninja Best Practices SSH Key Management Audit Logs Password Policy 2Factor Authentication Others License Management User Management Purchase SSL CertbotPlugin Apply or Redeem Coupon Code Account Statement Cloud Platform Support Introduction Platform Support Policy FAQ E2Es MyAccount FAQs Code of Conduct of Directors and Senior Management CSR Policy Whistle blower policy Jitsi Meet Mod Evasive Multisite using cPanel Softaculous Copying data from Linux to Windows using WinSCP Migrate MySQL Database Between DBaaS Manage MySQL Abuse Abuse Logs Abuse Attacks Spam Mails Phishing Complaint Copyright Complaint Billing Payment Payment Method EMandate Redeem Coupon Customer Details Updation Setup AutoDebit feature TDS Deduction process Declaration us 206AB Minimum Billing Provisioning and Deprovisioning Process View Invoice and Payment Prepaid Billing Set up Infra Credits Balance Alert Whatsapp notification for Payment reminder Restore Service on a Suspended Account for NonPayment Database Database Database PostgreSQL Parameter Group How to create Parameter Group MongoDB mariaDB Storage Storage Block Storage Object Storage CDP Backup Scalable File System Kubernetes Kubernetes Service Kubernetes Kubernetes Marketplace Monitoring Stack Cert Manager Nginx Ingress Controller Troubleshooting Argo CD Declarative GitOps CD for Kubernetes Deploy to Kubernetes using Argo CD and GitOps Jenkins CI Tool Setup Jenkins On Kubernetes Cluster Ansible CD Tool Istio Service Connecting to Dbaas FAQS Container Registery Container Registry Simplifying Pull Operations with UserFriendly Interface API Developers Guide API SDK E2E CLI Tool Introduction Terraform Terraform Getting Started e2enode Resource Node Plans e2eimage Resource AIML TIR AI Release Notes TIR AI Platform Introduction Getting Started Howto Guides Projects Notebooks Committed Notebook GPU H100 Plans Datasets Model Repository Model Endpoints Pipeline Run Scheduled Run Fine Tuning Models Model Playground Samples and Tutorials API Tokens SSH Key Container Team Features Settings Analytics Billing AIML Tutorials Finetune LLMA with Multiple GPUs Deploy Inference for LLMA 2 Deploy Inference for Codellama Deploy Inference for Stable Diffusion v21 Finetune Stable Diffusion model on TIR Deploy Inference for MPT7BCHAT Custom Containers in TIR Fine Tuning Bloom Natural Language Queries to SQL wth Code Llama E2E Networks documentation E2E Networks Kubernetes Service What is Istio What is Istio Istio is a service mesha modernized service networking layer that provides a transparent and languageindependent way to flexibly and easily automate application network functions It is a popular solution for managing the different microservices that make up a cloudnative application Istio service mesh also supports how those microservices communicate and share data with one another As organizations accelerate their moves to the cloud they are by necessity modernizing their applications as well But shifting from monolithic legacy apps to cloudnative ones can raise challenges for DevOps teams Developers must learn to assemble apps using loosely coupled microservices to ensure portability in the cloud At the same time ops teams must manage the new cloudnative apps within increasingly large hybrid and multicloud environments Istio allows them to do this Istio defined Istio is an open source service mesh that helps organizations run distributed microservicesbased apps anywhere Why use Istio Istio enables organizations to secure connect and monitor microservices so they can modernize their enterprise apps more swiftly and securely Istio manages traffic flows between services enforces access policies and aggregates telemetry data all without requiring changes to application code Istio eases deployment complexity by transparently layering onto existing distributed applications What are Istio service mesh benefits Achieve consistent service networking Your networking operators can consistently manage networking for all of their services without adding developer overhead Secure your services with Istio benefits Your security operators can easily implement servicetoservice security including authentication authorization and encryption Improve your application performance Implement best practices like canary rollouts and get deep visibility into your applications to identify where to focus your efforts to improve performance How to install Istio on a Kubernetes cluster Please follow the below mentioned steps to install the Istio on a Kubernetes cluster Download the Istio release from the Istio website httpsistioiolatestdocssetupinstallstandarddownload Extract the Istio files from the downloaded archive tar xvzf istio1161linuxamd64targz cd istio1161 Install Istio using the Istio operator kubectl apply f installkubernetesoperatoroperatoryaml Wait for the operator to start up and create the necessary resources kubectl rollout status deploymentistiooperator n istiooperator Install the Istio control plane kubectl apply f installkubernetesistiocontrolplaneyaml Verify that the Istio control plane has been installed successfully kubectl get pods n istiosystem You should see several Istiorelated pods running in the istiosystem namespace Install the Istio sidecar injection kubectl label namespace yournamespace istioinjectionenabled Replace yournamespace with the name of the namespace where you want to enable Istio sidecar injection Thats it You now have Istio installed in your Kubernetes cluster On this page Istio defined What are Istio service mesh benefits How to install Istio on a Kubernetes cluster Products TIR AI Platform GPU Dedicated Compute CPU Intensive Cloud High Memory Cloud Linux Smart Dedicated cPanel Linux Cloud Windows Cloud Windows SQL Cloud Plesk Windows Cloud GPU Smart Dedicated Load Balancer Company About Us Meet the Team Become a Partner E2E in Media Testimonials Investors Careers Contact Us Contact Sales Escalation Matrix Service Level Agreement Terms of Service Privacy Policy Refund Policy Policy FAQ Resources Blog Events Service Health Status Help White Papers Ecosystem Enablers Customers Certifications Countries Served FAQs E2E Networks Limited E2E Networks Limited is a NSE Listed AIFirst Hyperscale Cloud Computing Platform CIN Number L72900DL2009PLC341980 Copyright 2023 E2E Networks Limited


SSH Keys Management E2E Networks documentation Skip to content E2E Cloud Docs E2E Networks TIR Toggle navigation menu Login Sign Up E2E Networks documentation K Docs E2E Networks TIR Myaccount Getting Started with Myaccount SignUp Process for Indian Customers Customer validation Process for Indian Customers SignUp Process for International Customers Customer Validation Process for International Process Customer Validation Process for Contact Persons Domestic Customer Validation Process FAQs International Customer Validation Process FAQs Sign In Process Release Notes Compute Nodes Virtual Compute Nodes Monitoring 1Click Deployment Active Directory GPU GPU Cloud EQS Introduction How to Create EQS Actions Add Queue under tab Actions for queue service Using SDK Appliance Load Balancer Appliance Auto Scaling Introduction Concepts Define Scale Groups FaaS Function as a Service FaaS How to Create Functions Functions Information Network CDN VPC How to reserve an IP address Reserve IP Pool DNS Custom Reverse DNS Firewall Security Group Tag Security Firewall Bitninja Best Practices SSH Key Management Audit Logs Password Policy 2Factor Authentication Others License Management User Management Purchase SSL CertbotPlugin Apply or Redeem Coupon Code Account Statement Cloud Platform Support Introduction Platform Support Policy FAQ E2Es MyAccount FAQs Code of Conduct of Directors and Senior Management CSR Policy Whistle blower policy Jitsi Meet Mod Evasive Multisite using cPanel Softaculous Copying data from Linux to Windows using WinSCP Migrate MySQL Database Between DBaaS Manage MySQL Abuse Abuse Logs Abuse Attacks Spam Mails Phishing Complaint Copyright Complaint Billing Payment Payment Method EMandate Redeem Coupon Customer Details Updation Setup AutoDebit feature TDS Deduction process Declaration us 206AB Minimum Billing Provisioning and Deprovisioning Process View Invoice and Payment Prepaid Billing Set up Infra Credits Balance Alert Whatsapp notification for Payment reminder Restore Service on a Suspended Account for NonPayment Database Database Database PostgreSQL Parameter Group How to create Parameter Group MongoDB mariaDB Storage Storage Block Storage Object Storage CDP Backup Scalable File System Kubernetes Kubernetes Service Kubernetes Kubernetes Marketplace Monitoring Stack Cert Manager Nginx Ingress Controller Troubleshooting Argo CD Declarative GitOps CD for Kubernetes Deploy to Kubernetes using Argo CD and GitOps Jenkins CI Tool Setup Jenkins On Kubernetes Cluster Ansible CD Tool Istio Service Connecting to Dbaas FAQS Container Registery Container Registry Simplifying Pull Operations with UserFriendly Interface API Developers Guide API SDK E2E CLI Tool Introduction Terraform Terraform Getting Started e2enode Resource Node Plans e2eimage Resource AIML TIR AI Release Notes TIR AI Platform Introduction Getting Started Howto Guides Projects Notebooks Committed Notebook GPU H100 Plans Datasets Model Repository Model Endpoints Pipeline Run Scheduled Run Fine Tuning Models Model Playground Samples and Tutorials API Tokens SSH Key Container Team Features Settings Analytics Billing AIML Tutorials Finetune LLMA with Multiple GPUs Deploy Inference for LLMA 2 Deploy Inference for Codellama Deploy Inference for Stable Diffusion v21 Finetune Stable Diffusion model on TIR Deploy Inference for MPT7BCHAT Custom Containers in TIR Fine Tuning Bloom Natural Language Queries to SQL wth Code Llama E2E Networks documentation Welcome to TIR AI Platform Documentation SSH Keys Management SSH Keys Management Introduction Setting up SSHbased security to access your server is a much more effective way than the use of a manual root password Cracking the security system of a node depending on SSH keys is nearly impossible since it secures your node in a more sophisticated way by the use of encoded keys Why is passwordbased authentication vulnerable A server can authenticate grant access to the users with different access methods The most basic of these is a passwordbased authentication which is easy to use but isnt the most secure Modern processing power combined with automated scripts makes bruteforcing a passwordprotected account very possible since passwords generally are not complex SSH keys prove to be a reliable and secure alternative What are SSH keys SSH key pairs are two cryptographically secure keys that can be used to authenticate a client to an SSH server Each key pair consists of a public key and a private key The private key is retained by the client on his local machine and should be kept secret Any compromise of the private key will allow the attacker to log into servers that are configured with the associated public key without additional authentication As an additional precaution the key can be encrypted on disk with a passphrase The public key is uploaded onto the remote server that you want to be able to log into with SSH When a client attempts to authenticate using SSH keys the server can test the client on whether they are in possession of the private key If the keypair matches then a shell session is spawned or the requested command is executed How do SSH keys work A key pair will be generated on your local PC Generating a key pair provides you with two long string of characters a public and a private key The public key will be added to your node The corresponding private key pair will be saved on your local PC Every time you access your node the SSH system will lookup for the private key pair of the public key added to it The system will unlock only when the two keys match You can also disable the root password after the SSH keys are set up Note Secure the private key Make sure that you add the public key to the servers and the private key is saved in a secure location on your PC Manage SSH Keys This guide shows you how to access manage your SSH keys into E2E Networks TIR AI PLATEFORM Logging into E2E Networks TIR AI PLATEFORM Please go to TIR AI PLATEFORM and log in using your credentials set up at the time of creating and activating the E2E Networks TIR AI PLATEFORM Navigate to SSH Keys After you log in to the E2E Networks TIR AI PLATEFORM you can click on the left side of the TIR AI PLATEFORM dashboard click on the SSH Keys submenu available under the services menu AddDelete SSH Keys If you do not have SSH keys and want to create an SSH key pair to access your node then follow the tutorial for your computer OS MAC Windows Linux ADD SSH Keys Click on Add Key button You need to label your SSH key optional field for easy identification purpose You can either load the file to add public SSH Key by clicking the Load from file or paste the contents of your public SSH key copy it as it is and paste it in in the SSH Key content field Note Before you paste your public SSH keys into your content field you must check the format of each public SSH key file that you plan to add After adding the public key you need to click the Add Key button you will be automatically routed to the Manage SSH Keys page Similarly you can store multiple SSH Public Keys into TIR AI PLATEFORM which will be accessible to multiple users with different SSH keypairs Delete SSH Keys To remove a public key click on the delete button which will permanently delete your public key Note Any user accessing the node from the SSH keypair will not be able to access the node once the key is removed from My Account Using an SSH Key Now the SSH key is added to your TIR AI PLATEFORM which can be used with any new notebook that you create in the future by simply selecting the public key during a notebook notebook creation process You can also refer enabledisable passwordbased authentication for SSH access to the server On this page Introduction Manage SSH Keys Logging into E2E Networks TIR AI PLATEFORM Navigate to SSH Keys AddDelete SSH Keys ADD SSH Keys Delete SSH Keys Using an SSH Key Products TIR AI Platform GPU Dedicated Compute CPU Intensive Cloud High Memory Cloud Linux Smart Dedicated cPanel Linux Cloud Windows Cloud Windows SQL Cloud Plesk Windows Cloud GPU Smart Dedicated Load Balancer Company About Us Meet the Team Become a Partner E2E in Media Testimonials Investors Careers Contact Us Contact Sales Escalation Matrix Service Level Agreement Terms of Service Privacy Policy Refund Policy Policy FAQ Resources Blog Events Service Health Status Help White Papers Ecosystem Enablers Customers Certifications Countries Served FAQs E2E Networks Limited E2E Networks Limited is a NSE Listed AIFirst Hyperscale Cloud Computing Platform CIN Number L72900DL2009PLC341980 Copyright 2023 E2E Networks Limited


Finetune Stable Diffusion model on TIR E2E Networks documentation Skip to content E2E Cloud Docs E2E Networks TIR Toggle navigation menu Login Sign Up E2E Networks documentation K Docs E2E Networks TIR Myaccount Getting Started with Myaccount SignUp Process for Indian Customers Customer validation Process for Indian Customers SignUp Process for International Customers Customer Validation Process for International Process Customer Validation Process for Contact Persons Domestic Customer Validation Process FAQs International Customer Validation Process FAQs Sign In Process Release Notes Compute Nodes Virtual Compute Nodes Monitoring 1Click Deployment Active Directory GPU GPU Cloud EQS Introduction Appliance Load Balancer Appliance Auto Scaling Introduction Concepts Define Scale Groups FaaS Function as a Service FaaS Network CDN VPC How to reserve an IP address Reserve IP Pool DNS Custom Reverse DNS Firewall Security Group Tag Security Firewall Bitninja Best Practices SSH Key Management Audit Logs Password Policy 2Factor Authentication Others License Management User Management Purchase SSL CertbotPlugin Apply or Redeem Coupon Code Account Statement Cloud Platform Support Introduction Platform Support Policy FAQ E2Es MyAccount FAQs Code of Conduct of Directors and Senior Management CSR Policy Whistle blower policy Jitsi Meet Mod Evasive Multisite using cPanel Softaculous Copying data from Linux to Windows using WinSCP Migrate MySQL Database Between DBaaS Manage MySQL Abuse Abuse Logs Abuse Attacks Spam Mails Phishing Complaint Copyright Complaint Billing Payment Payment Method EMandate Redeem Coupon Customer Details Updation Setup AutoDebit feature TDS Deduction process Declaration us 206AB Minimum Billing Provisioning and Deprovisioning Process View Invoice and Payment Prepaid Billing Set up Infra Credits Balance Alert Whatsapp notification for Payment reminder Restore Service on a Suspended Account for NonPayment Database Database Database PostgreSQL Parameter Group MongoDB mariaDB Storage Storage Block Storage Object Storage CDP Backup Scalable File System Kubernetes Kubernetes Service Kubernetes Kubernetes Marketplace Monitoring Stack Cert Manager Nginx Ingress Controller Troubleshooting Argo CD Declarative GitOps CD for Kubernetes Deploy to Kubernetes using Argo CD and GitOps Jenkins CI Tool Setup Jenkins On Kubernetes Cluster Ansible CD Tool Istio Service Connecting to Dbaas FAQS Container Registery Container Registery API Developers Guide API SDK E2E CLI Tool Introduction Terraform Terraform Getting Started e2enode Resource Node Plans e2eimage Resource AIML TIR AI Release Notes TIR AI Platform Introduction Getting Started Howto Guides Projects Notebooks Committed Notebook GPU H100 Plans Datasets Model Repository Model Endpoints Pipeline Run Scheduled Run Fine Tuning Models Model Playground Samples and Tutorials API Tokens SSH Key Container Team Features Settings Analytics Billing AIML Tutorials Finetune LLMA with Multiple GPUs Deploy Inference for LLMA 2 Deploy Inference for Codellama Deploy Inference for Stable Diffusion v21 Finetune Stable Diffusion model on TIR Deploy Inference for MPT7BCHAT Custom Containers in TIR Fine Tuning Bloom Natural Language Queries to SQL wth Code Llama E2E Networks documentation Welcome to TIR AI Platform Documentation Tutorials Finetune Stable Diffusion model on TIR Finetune Stable Diffusion model on TIR In this tutorial we will finetune Stability AIs Stable Diffusion v21 model via Dreambooth Textual Inversion training methods using Hugging Face Diffusers library By using just 35 images we will be able to teach new concepts to Stable Diffusion and personalize the model on our own images About Training methods The Stable Diffusion model can be finetuned via any of the two training methods ie Dreambooth or Textual Inversion So before tarining the model let us get a brief overview of the two training methods Dreambooth DreamBooth is a way to fine tune Stable Diffusion to generate a subject in different environments and styles It teaches the diffusion model about a specific object or style using approximately three to five example images After the model is finetuned on a specific object it can produce images containing that object in new settings You can read the original paper here Heres how it works You provide a set of reference images to teach the model how the subject looks You retrain the model to learn to associate that subject with a specific word You prompt the new model using the special word With DreamBooth were training an entirely new version of Stable Diffusion It will be an entirely selfsufficient version of a model that can yield pretty good results to the cost of bigger models Textual Inversion The Textual Inversion training method captures new concepts from a small number of example images and associates the concepts with new words in the textual embedding space of the pretrained model Using only 35 images of a userprovided concept like an object or a style we learn to represent it through new words in the textual embedding space These words can be used into natural language sentences in the form of text prompts guiding personalized image creation in an intuitive way You can read the original paper here Heres how it works You provide a set of reference images of your subject You figure out what specific embedding the model associates with those images You prompt the new model using the embedding Textual Inversion is basically akin to finding a special word that gets your model to produce the images that you want Fine tuning the model Step1 Launch a Notebook on TIR Before beginning let us launch a Notebook on TIR to train our model To launch the notebook follow the steps below Go to TIR Dashboard Choose a Project navigate to the Notebooks section and click on Create Notebook button Let us name the notebook as stablediffusionfinetune You can give any name of your choice Notebook Image Machine Launch a new Notebook with Diffusers Image and a GPU Machine plan To finetune the model we recommend choosing a GPU plan from one of A100 A40 or A30 series eg GDC3A1008016115GB Disk Size A default Disk Size of 30GB would be sufficient for our usecase In case you need more space set the disk size accordingly Datasets If you have your training data stored in a TIR Dataset select that dataset to be able to use it during fine tuning Create the notebook Launch Notebook Once the notebook comes to Running state launch the notebook by clicking on the three dots and start the start jupyter labs environment The sidebar on the left also displayes quick launch links for your notebooks In the jupyter labs create a new Python3 Notebook from the New Launcher window A new ipynb file will open in jupyter labs Our notebook is ready Now lets proceed with the model training Note This tutorial covers both DreamBooth and Textual Inversion training methods Most of the steps and code are the same for both the methods But when they are different we have used tabs to separate the two training methods Step2 Initial Setup Install the required libraries pip install qq ftfy Import the required libraries and packages DreamboothTextual Inversionimport argparse import itertools import math import os from contextlib import nullcontext import random import numpy as np import torch import torchnnfunctional as F import torchutilscheckpoint from torchutilsdata import Dataset import PIL from accelerate import Accelerator from acceleratelogging import getlogger from accelerateutils import setseed from diffusers import AutoencoderKL DDPMScheduler PNDMScheduler StableDiffusionPipeline UNet2DConditionModel from diffusersoptimization import getscheduler from diffuserspipelinesstablediffusion import StableDiffusionSafetyChecker from PIL import Image from torchvision import transforms from tqdmauto import tqdm from transformers import CLIPFeatureExtractor CLIPTextModel CLIPTokenizer import bitsandbytes as bnb import argparse import itertools import math import os import random import numpy as np import torch import torchnnfunctional as F import torchutilscheckpoint from torchutilsdata import Dataset import PIL from accelerate import Accelerator from acceleratelogging import getlogger from accelerateutils import setseed from diffusers import AutoencoderKL DDPMScheduler PNDMScheduler StableDiffusionPipeline UNet2DConditionModel from diffusersoptimization import getscheduler from diffuserspipelinesstablediffusion import StableDiffusionSafetyChecker from PIL import Image from torchvision import transforms from tqdmauto import tqdm from transformers import CLIPFeatureExtractor CLIPTextModel CLIPTokenizer Now lets define some helper functions that we will need gradually during the training and inference process def imagegridimgs rows cols display multiple images in a grid assert lenimgs rowscols w h imgs0size grid ImagenewRGB sizecolsw rowsh gridw gridh gridsize for i img in enumerateimgs gridpasteimg boxicolsw icolsh return grid Step3 Settings for teaching the new concept 31 Defining the Model Specify the Stable Diffusion model that we want to train For this tutorial we will use Stable Diffusion v21 stabilityaistablediffusion21 pretrainedmodelnameorpath defines the Stable Diffusion checkpoint you want to use pretrainedmodelnameorpath stabilityaistablediffusion21 using Stable Diffusion v21 some other models that you can use stabilityaistablediffusion21 stabilityaistablediffusion2 stabilityaistablediffusion2base CompVisstablediffusionv14 runwaymlstablediffusionv15 32 Input Images To teach the model a new concept we need 35 input images with the help of which we will train the model So lets gather and setup the images for training purpose There can be multiple sources for the input images Setup the input images using any one of the three sources Images available on the Internet Using the public image urls we can download the images from the internet and save them locally on Notebook Add the URLs to the images of the concept you are adding 35 should be fine urls httpshuggingfacecodatasetsvalhallaimagesresolvemain2jpeg httpshuggingfacecodatasetsvalhallaimagesresolvemain3jpeg httpshuggingfacecodatasetsvalhallaimagesresolvemain5jpeg httpshuggingfacecodatasetsvalhallaimagesresolvemain6jpeg You can add additional image urls here Download the images from urls import requests import glob from io import BytesIO def downloadimageurl try response requestsgeturl except return None return ImageopenBytesIOresponsecontentconvertRGB images listfilterNone downloadimageurl for url in urls save the images in a directory savepath myconcept if not ospathexistssavepath osmkdirsavepath imagesavefsavepathijpeg for i image in enumerateimages Images stored in a TIR Dataset To use the images stored in a TIR Dataset ensure that the particular dataset containing your images is mounted on the notebook Note How to check if your Dataset is mounted on the notebook Go to TIR Dashboard Notebooks Section Select the notebook Go to the Associated Datsets Tab You will be able to see the list of Datasets mounted on your notebook If your desired dataset is not in the list you can mount it now You can also open the terminal and list all the mounted datasets using the ls datasets command If you have updated the mounted dataset wait for your notebook to be back in Running state and start afresh from Step2 PS Dataset and Notebook must be in the same project else you cannot mount it on the notebook Specify your dataset name and the directory path conatining the images in the below code block and run the code cell datasetname enter the dataset name imagesdir enter path to directory containing the training images imagespath ospathjoindatasets strdatasetname strimagesdir datasetsdatasetnameimagespath if not datasetname printdatasetname must be provided elif not ospathexistsstrimagespath printThe imagespath specified does not exist Check the path and try again else savepath imagespath Images present on your local system You can load your own training images by uploading them to the notebook using the Upload Files option imagespath is a path to directory containing the training images imagespath type string if not ospathexistsstrimagespath printThe imagespath specified does not exist Check the path and try again else savepath imagespath Note Make sure that your input image directory only contains input images as the code will read all the files from the provided directory and it will interfere with the training process Before proceeding further let us first check our training images images for filepath in oslistdirsavepath try imagepath ospathjoinsavepath filepath imagesappendImageopenimagepathresize512 512 except printfimagepath is not a valid image please make sure to remove this file from the directory otherwise the training could fail imagegridimages 1 lenimages Output 33 Settings for the new concept DreamboothTextual Inversion instanceprompt is a prompt that should contain a good description of what your object or style is together with the initializer word cattoy instanceprompt cattoy toy type string Check the priorpreservation option if you would like class of the concept eg toy dog painting is guaranteed to be preserved This increases the quality and helps with generalization at the cost of training time priorpreservation False type bool priorpreservationclassprompt a photo of a cat clay toy type string numclassimages 12 samplebatchsize 2 priorlossweight 05 priorpreservationclassfolder classimages classdataroot priorpreservationclassfolder classprompt priorpreservationclassprompt Advanced settings for prior preservation optional numclassimages 12 type int samplebatchsize 2 priorpreservationweight determines how strong the class for prior preservation should be priorlossweight 1 type int If the priorpreservationclassfolder is empty images for the class will be generated with the class prompt Otherwise fill this folder with images of items on the same class as your concept but not images of the concept itself priorpreservationclassfolder classimages type string classdataroot priorpreservationclassfolder whattoteach what is it that you are teaching object enables you to teach the model a new object to be used style allows you to teach the model a new style one can use whattoteach object allowed values object style placeholdertoken the token you are going to use to represent your new concept so when you prompt the model you will say A myplaceholdertoken in an amusement park We use angle brackets to differentiate a token from other wordstokens to avoid collision placeholdertoken cattoy type string initializertoken a word that can summarise what your new concept is to be used as a starting point initializertoken toy type string Step4 Teach the model the new concept Finetuning with the training method Execute the below sequence of cells to run the training process The whole process may take from 30 min to 3 hours Open this block if you are interested in how this process works under the hood or if you want to change advanced training settings or hyperparameters 41 Setup for Training DreamboothTextual InversionSetup the classes from pathlib import Path from torchvision import transforms class DreamBoothDatasetDataset def init self instancedataroot instanceprompt tokenizer classdatarootNone classpromptNone size512 centercropFalse selfsize size selfcentercrop centercrop selftokenizer tokenizer selfinstancedataroot Pathinstancedataroot if not selfinstancedatarootexists raise ValueErrorInstance images root doesnt exists selfinstanceimagespath listPathinstancedatarootiterdir selfnuminstanceimages lenselfinstanceimagespath selfinstanceprompt instanceprompt selflength selfnuminstanceimages if classdataroot is not None selfclassdataroot Pathclassdataroot selfclassdatarootmkdirparentsTrue existokTrue selfclassimagespath listPathclassdatarootiterdir selfnumclassimages lenselfclassimagespath selflength maxselfnumclassimages selfnuminstanceimages selfclassprompt classprompt else selfclassdataroot None selfimagetransforms transformsCompose transformsResizesize interpolationtransformsInterpolationModeBILINEAR transformsCenterCropsize if centercrop else transformsRandomCropsize transformsToTensor transformsNormalize05 05 def lenself return selflength def getitemself index example instanceimage Imageopenselfinstanceimagespathindex selfnuminstanceimages if not instanceimagemode RGB instanceimage instanceimageconvertRGB exampleinstanceimages selfimagetransformsinstanceimage exampleinstancepromptids selftokenizer selfinstanceprompt paddingdonotpad truncationTrue maxlengthselftokenizermodelmaxlength inputids if selfclassdataroot classimage Imageopenselfclassimagespathindex selfnumclassimages if not classimagemode RGB classimage classimageconvertRGB exampleclassimages selfimagetransformsclassimage exampleclasspromptids selftokenizer selfclassprompt paddingdonotpad truncationTrue maxlengthselftokenizermodelmaxlength inputids return example class PromptDatasetDataset def initself prompt numsamples selfprompt prompt selfnumsamples numsamples def lenself return selfnumsamples def getitemself index example exampleprompt selfprompt exampleindex index return example Generate Class Images import gc ifpriorpreservation classimagesdir Pathclassdataroot if not classimagesdirexists classimagesdirmkdirparentsTrue curclassimages lenlistclassimagesdiriterdir if curclassimages numclassimages pipeline StableDiffusionPipelinefrompretrained pretrainedmodelnameorpath revisionfp16 torchdtypetorchfloat16 tocuda pipelineenableattentionslicing pipelinesetprogressbarconfigdisableTrue numnewimages numclassimages curclassimages printfNumber of class images to sample numnewimages sampledataset PromptDatasetclassprompt numnewimages sampledataloader torchutilsdataDataLoadersampledataset batchsizesamplebatchsize for example in tqdmsampledataloader descGenerating class images images pipelineexamplepromptimages for i image in enumerateimages imagesaveclassimagesdir fexampleindexi curclassimagesjpg pipeline None gccollect del pipeline with torchnograd torchcudaemptycache Load the Stable Diffusion Model Load models and create wrapper for stable diffusion textencoder CLIPTextModelfrompretrained pretrainedmodelnameorpath subfoldertextencoder vae AutoencoderKLfrompretrained pretrainedmodelnameorpath subfoldervae unet UNet2DConditionModelfrompretrained pretrainedmodelnameorpath subfolderunet tokenizer CLIPTokenizerfrompretrained pretrainedmodelnameorpath subfoldertokenizer Create Dataset Setup the prompt templates for training imagenettemplatessmall a photo of a a rendering of a a cropped photo of the the photo of a a photo of a clean a photo of a dirty a dark photo of the a photo of my a photo of the cool a closeup photo of a a bright photo of the a cropped photo of a a photo of the a good photo of the a photo of one a closeup photo of the a rendition of the a photo of the clean a rendition of a a photo of a nice a good photo of a a photo of the nice a photo of the small a photo of the weird a photo of the large a photo of a cool a photo of a small imagenetstyletemplatessmall a painting in the style of a rendering in the style of a cropped painting in the style of the painting in the style of a clean painting in the style of a dirty painting in the style of a dark painting in the style of a picture in the style of a cool painting in the style of a closeup painting in the style of a bright painting in the style of a cropped painting in the style of a good painting in the style of a closeup painting in the style of a rendition in the style of a nice painting in the style of a small painting in the style of a weird painting in the style of a large painting in the style of Setup the Dataset Setup the dataset class TextualInversionDatasetDataset def init self dataroot tokenizer learnablepropertyobject object style size512 repeats100 interpolationbicubic flipp05 settrain placeholdertoken centercropFalse selfdataroot dataroot selftokenizer tokenizer selflearnableproperty learnableproperty selfsize size selfplaceholdertoken placeholdertoken selfcentercrop centercrop selfflipp flipp selfimagepaths ospathjoinselfdataroot filepath for filepath in oslistdirselfdataroot selfnumimages lenselfimagepaths selflength selfnumimages if set train selflength selfnumimages repeats selfinterpolation linear PILImageResamplingLINEAR Removed in version 1000 use bilinear instead bilinear PILImageResamplingBILINEAR bicubic PILImageResamplingBICUBIC lanczos PILImageResamplingLANCZOS interpolation selftemplates imagenetstyletemplatessmall if learnableproperty style else imagenettemplatessmall selffliptransform transformsRandomHorizontalFlippselfflipp def lenself return selflength def getitemself i example image Imageopenselfimagepathsi selfnumimages if not imagemode RGB image imageconvertRGB placeholderstring selfplaceholdertoken text randomchoiceselftemplatesformatplaceholderstring exampleinputids selftokenizer text paddingmaxlength truncationTrue maxlengthselftokenizermodelmaxlength returntensorspt inputids0 default to scoresde preprocessing img nparrayimageastypenpuint8 if selfcentercrop crop minimgshape0 imgshape1 h w imgshape0 imgshape1 img imgh crop 2 h crop 2 w crop 2 w crop 2 image Imagefromarrayimg image imageresizeselfsize selfsize resampleselfinterpolation image selffliptransformimage image nparrayimageastypenpuint8 image image 1275 10astypenpfloat32 examplepixelvalues torchfromnumpyimagepermute2 0 1 return example Set up the Model Load the tokenizer and add the placeholder token as a additional special token tokenizer CLIPTokenizerfrompretrained pretrainedmodelnameorpath subfoldertokenizer Add the placeholder token in tokenizer numaddedtokens tokenizeraddtokensplaceholdertoken if numaddedtokens 0 raise ValueError fThe tokenizer already contains the token placeholdertoken Please pass a different placeholdertoken that is not already in the tokenizer Get token ids for our placeholder and initializer token This code block will complain if initializer string is not a single token Convert the initializertoken placeholdertoken to ids tokenids tokenizerencodeinitializertoken addspecialtokensFalse Check if initializertoken is a single token or a sequence of tokens if lentokenids 1 raise ValueErrorThe initializer token must be a single token initializertokenid tokenids0 placeholdertokenid tokenizerconverttokenstoidsplaceholdertoken Load the Stable Diffusion model Load models and create wrapper for stable diffusion textencoder CLIPTextModelfrompretrained pretrainedmodelnameorpath subfoldertextencoder vae AutoencoderKLfrompretrained pretrainedmodelnameorpath subfoldervae unet UNet2DConditionModelfrompretrained pretrainedmodelnameorpath subfolderunet We have added the placeholdertoken in the tokenizer so we resize the token embeddings here this will a new embedding vector in the token embeddings for our placeholdertoken textencoderresizetokenembeddingslentokenizer Initialise the newly added placeholder token with the embeddings of the initializer token tokenembeds textencodergetinputembeddingsweightdata tokenembedsplaceholdertokenid tokenembedsinitializertokenid In TextualInversion we only train the newly added embedding vector so lets freeze rest of the model parameters here def freezeparamsparams for param in params paramrequiresgrad False Freeze vae and unet freezeparamsvaeparameters freezeparamsunetparameters Freeze all parameters except for the token embeddings in text encoder paramstofreeze itertoolschain textencodertextmodelencoderparameters textencodertextmodelfinallayernormparameters textencodertextmodelembeddingspositionembeddingparameters freezeparamsparamstofreeze Creating our training data Creation of Dataset Dataloader and noisescheduler create dataset for training traindataset TextualInversionDataset datarootsavepath tokenizertokenizer sizevaesamplesize placeholdertokenplaceholdertoken repeats100 learnablepropertywhattoteach Option selected above between object and style centercropFalse settrain create dataloader for training def createdataloadertrainbatchsize1 return torchutilsdataDataLoadertraindataset batchsizetrainbatchsize shuffleTrue Create noisescheduler for training noisescheduler DDPMSchedulerfromconfigpretrainedmodelnameorpath subfolderscheduler 42 Training Setting up the training args and define hyperparameters for the training You can also tune the hyperparameters like learningrate maxtrainsteps etc to play around DreamboothTextual Inversionfrom argparse import Namespace args Namespace pretrainedmodelnameorpathpretrainedmodelnameorpath resolutionvaesamplesize centercropTrue traintextencoderFalse instancedatadirsavepath instancepromptinstanceprompt learningrate5e06 maxtrainsteps300 savesteps50 trainbatchsize2 set to 1 if using prior preservation gradientaccumulationsteps2 maxgradnorm10 mixedprecisionfp16 set to fp16 for mixedprecision training gradientcheckpointingTrue set this to True to lower the memory usage use8bitadamTrue use 8bit optimizer from bitsandbytes seed3434554 withpriorpreservationpriorpreservation priorlossweightpriorlossweight samplebatchsize2 classdatadirpriorpreservationclassfolder classpromptpriorpreservationclassprompt numclassimagesnumclassimages lrschedulerconstant lrwarmupsteps100 outputdirdreamboothconcept hyperparameters learningrate 5e04 scalelr True maxtrainsteps 2000 savesteps 250 trainbatchsize 4 gradientaccumulationsteps 1 gradientcheckpointing True mixedprecision fp16 seed 42 outputdir textualinversionconcept mkdir p textualinversionconcept Define the training function DreamboothTextual Inversionfrom accelerateutils import setseed def trainingfunctiontextencoder vae unet logger getloggername setseedargsseed accelerator Accelerator gradientaccumulationstepsargsgradientaccumulationsteps mixedprecisionargsmixedprecision Currently its not possible to do gradient accumulation when training two models with accelerateaccumulate This will be enabled soon in accelerate For now we dont allow gradient accumulation when training two models if argstraintextencoder and argsgradientaccumulationsteps 1 and acceleratornumprocesses 1 raise ValueError Gradient accumulation is not supported when training the text encoder in distributed training Please set gradientaccumulationsteps to 1 This feature will be supported in the future vaerequiresgradFalse if not argstraintextencoder textencoderrequiresgradFalse if argsgradientcheckpointing unetenablegradientcheckpointing if argstraintextencoder textencodergradientcheckpointingenable Use 8bit Adam for lower memory usage or to finetune the model in 16GB GPUs if argsuse8bitadam optimizerclass bnboptimAdamW8bit else optimizerclass torchoptimAdamW paramstooptimize itertoolschainunetparameters textencoderparameters if argstraintextencoder else unetparameters optimizer optimizerclass paramstooptimize lrargslearningrate noisescheduler DDPMSchedulerfromconfigargspretrainedmodelnameorpath subfolderscheduler traindataset DreamBoothDataset instancedatarootargsinstancedatadir instancepromptargsinstanceprompt classdatarootargsclassdatadir if argswithpriorpreservation else None classpromptargsclassprompt tokenizertokenizer sizeargsresolution centercropargscentercrop def collatefnexamples inputids exampleinstancepromptids for example in examples pixelvalues exampleinstanceimages for example in examples concat class and instance examples for prior preservation if argswithpriorpreservation inputids exampleclasspromptids for example in examples pixelvalues exampleclassimages for example in examples pixelvalues torchstackpixelvalues pixelvalues pixelvaluestomemoryformattorchcontiguousformatfloat inputids tokenizerpad inputids inputids paddingmaxlength returntensorspt maxlengthtokenizermodelmaxlength inputids batch inputids inputids pixelvalues pixelvalues return batch traindataloader torchutilsdataDataLoader traindataset batchsizeargstrainbatchsize shuffleTrue collatefncollatefn lrscheduler getscheduler argslrscheduler optimizeroptimizer numwarmupstepsargslrwarmupsteps argsgradientaccumulationsteps numtrainingstepsargsmaxtrainsteps argsgradientaccumulationsteps if argstraintextencoder unet textencoder optimizer traindataloader lrscheduler acceleratorprepare unet textencoder optimizer traindataloader lrscheduler else unet optimizer traindataloader lrscheduler acceleratorprepare unet optimizer traindataloader lrscheduler weightdtype torchfloat32 if acceleratormixedprecision fp16 weightdtype torchfloat16 elif acceleratormixedprecision bf16 weightdtype torchbfloat16 Move textencode and vae to gpu For mixed precision training we cast the textencoder and vae weights to halfprecision as these models are only used for inference keeping weights in full precision is not required vaetoacceleratordevice dtypeweightdtype vaedecodertocpu if not argstraintextencoder textencodertoacceleratordevice dtypeweightdtype We need to recalculate our total training steps as the size of the training dataloader may have changed numupdatestepsperepoch mathceillentraindataloader argsgradientaccumulationsteps numtrainepochs mathceilargsmaxtrainsteps numupdatestepsperepoch Train totalbatchsize argstrainbatchsize acceleratornumprocesses argsgradientaccumulationsteps loggerinfo Running training loggerinfof Num examples lentraindataset loggerinfof Instantaneous batch size per device argstrainbatchsize loggerinfof Total train batch size w parallel distributed accumulation totalbatchsize loggerinfof Gradient Accumulation steps argsgradientaccumulationsteps loggerinfof Total optimization steps argsmaxtrainsteps Only show the progress bar once on each machine progressbar tqdmrangeargsmaxtrainsteps disablenot acceleratorislocalmainprocess progressbarsetdescriptionSteps globalstep 0 for epoch in rangenumtrainepochs unettrain for step batch in enumeratetraindataloader with acceleratoraccumulateunet Convert images to latent space latents vaeencodebatchpixelvaluestodtypeweightdtypelatentdistsample latents latents 018215 Sample noise that well add to the latents noise torchrandnlikelatents bsz latentsshape0 Sample a random timestep for each image timesteps torchrandint0 noiseschedulerconfignumtraintimesteps bsz devicelatentsdevice timesteps timestepslong Add noise to the latents according to the noise magnitude at each timestep this is the forward diffusion process noisylatents noisescheduleraddnoiselatents noise timesteps Get the text embedding for conditioning encoderhiddenstates textencoderbatchinputids0 Predict the noise residual noisepred unetnoisylatents timesteps encoderhiddenstatessample Get the target for loss depending on the prediction type if noiseschedulerconfigpredictiontype epsilon target noise elif noiseschedulerconfigpredictiontype vprediction target noiseschedulergetvelocitylatents noise timesteps else raise ValueErrorfUnknown prediction type noiseschedulerconfigpredictiontype if argswithpriorpreservation Chunk the noise and noisepred into two parts and compute the loss on each part separately noisepred noisepredprior torchchunknoisepred 2 dim0 target targetprior torchchunktarget 2 dim0 Compute instance loss loss Fmselossnoisepredfloat targetfloat reductionnonemean1 2 3mean Compute prior loss priorloss Fmselossnoisepredpriorfloat targetpriorfloat reductionmean Add the prior loss to the instance loss loss loss argspriorlossweight priorloss else loss Fmselossnoisepredfloat targetfloat reductionmean acceleratorbackwardloss if acceleratorsyncgradients paramstoclip itertoolschainunetparameters textencoderparameters if argstraintextencoder else unetparameters acceleratorclipgradnormunetparameters argsmaxgradnorm optimizerstep optimizerzerograd Checks if the accelerator has performed an optimization step behind the scenes if acceleratorsyncgradients progressbarupdate1 globalstep 1 if globalstep argssavesteps 0 if acceleratorismainprocess pipeline StableDiffusionPipelinefrompretrained argspretrainedmodelnameorpath unetacceleratorunwrapmodelunet textencoderacceleratorunwrapmodeltextencoder savepath ospathjoinargsoutputdir fcheckpointglobalstep pipelinesavepretrainedsavepath logs loss lossdetachitem progressbarsetpostfixlogs if globalstep argsmaxtrainsteps break acceleratorwaitforeveryone Create the pipeline using using the trained modules and save it if acceleratorismainprocess pipeline StableDiffusionPipelinefrompretrained argspretrainedmodelnameorpath unetacceleratorunwrapmodelunet textencoderacceleratorunwrapmodeltextencoder pipelinesavepretrainedargsoutputdir logger getloggername def saveprogresstextencoder placeholdertokenid accelerator savepath loggerinfoSaving embeddings learnedembeds acceleratorunwrapmodeltextencodergetinputembeddingsweightplaceholdertokenid learnedembedsdict placeholdertoken learnedembedsdetachcpu torchsavelearnedembedsdict savepath def trainingfunctiontextencoder vae unet trainbatchsize hyperparameterstrainbatchsize gradientaccumulationsteps hyperparametersgradientaccumulationsteps learningrate hyperparameterslearningrate maxtrainsteps hyperparametersmaxtrainsteps outputdir hyperparametersoutputdir gradientcheckpointing hyperparametersgradientcheckpointing accelerator Accelerator gradientaccumulationstepsgradientaccumulationsteps mixedprecisionhyperparametersmixedprecision if gradientcheckpointing textencodergradientcheckpointingenable unetenablegradientcheckpointing traindataloader createdataloadertrainbatchsize if hyperparametersscalelr learningrate learningrate gradientaccumulationsteps trainbatchsize acceleratornumprocesses Initialize the optimizer optimizer torchoptimAdamW textencodergetinputembeddingsparameters only optimize the embeddings lrlearningrate textencoder optimizer traindataloader acceleratorprepare textencoder optimizer traindataloader weightdtype torchfloat32 if acceleratormixedprecision fp16 weightdtype torchfloat16 elif acceleratormixedprecision bf16 weightdtype torchbfloat16 Move vae and unet to device vaetoacceleratordevice dtypeweightdtype unettoacceleratordevice dtypeweightdtype Keep vae in eval mode as we dont train it vaeeval Keep unet in train mode to enable gradient checkpointing unettrain We need to recalculate our total training steps as the size of the training dataloader may have changed numupdatestepsperepoch mathceillentraindataloader gradientaccumulationsteps numtrainepochs mathceilmaxtrainsteps numupdatestepsperepoch Train totalbatchsize trainbatchsize acceleratornumprocesses gradientaccumulationsteps loggerinfo Running training loggerinfof Num examples lentraindataset loggerinfof Instantaneous batch size per device trainbatchsize loggerinfof Total train batch size w parallel distributed accumulation totalbatchsize loggerinfof Gradient Accumulation steps gradientaccumulationsteps loggerinfof Total optimization steps maxtrainsteps Only show the progress bar once on each machine progressbar tqdmrangemaxtrainsteps disablenot acceleratorislocalmainprocess progressbarsetdescriptionSteps globalstep 0 for epoch in rangenumtrainepochs textencodertrain for step batch in enumeratetraindataloader with acceleratoraccumulatetextencoder Convert images to latent space latents vaeencodebatchpixelvaluestodtypeweightdtypelatentdistsampledetach latents latents 018215 Sample noise that well add to the latents noise torchrandnlikelatents bsz latentsshape0 Sample a random timestep for each image timesteps torchrandint0 noiseschedulernumtraintimesteps bsz devicelatentsdevicelong Add noise to the latents according to the noise magnitude at each timestep this is the forward diffusion process noisylatents noisescheduleraddnoiselatents noise timesteps Get the text embedding for conditioning encoderhiddenstates textencoderbatchinputids0 Predict the noise residual noisepred unetnoisylatents timesteps encoderhiddenstatestoweightdtypesample Get the target for loss depending on the prediction type if noiseschedulerconfigpredictiontype epsilon target noise elif noiseschedulerconfigpredictiontype vprediction target noiseschedulergetvelocitylatents noise timesteps else raise ValueErrorfUnknown prediction type noiseschedulerconfigpredictiontype loss Fmselossnoisepred target reductionnonemean1 2 3mean acceleratorbackwardloss Zero out the gradients for all token embeddings except the newly added embeddings for the concept as we only want to optimize the concept embeddings if acceleratornumprocesses 1 grads textencodermodulegetinputembeddingsweightgrad else grads textencodergetinputembeddingsweightgrad Get the index for tokens that we want to zero the grads for indexgradstozero torcharangelentokenizer placeholdertokenid gradsdataindexgradstozero gradsdataindexgradstozero fill0 optimizerstep optimizerzerograd Checks if the accelerator has performed an optimization step behind the scenes if acceleratorsyncgradients progressbarupdate1 globalstep 1 if globalstep hyperparameterssavesteps 0 savepath ospathjoinoutputdir flearnedembedsstepglobalstepbin saveprogresstextencoder placeholdertokenid accelerator savepath logs loss lossdetachitem progressbarsetpostfixlogs if globalstep maxtrainsteps break acceleratorwaitforeveryone Create the pipeline using using the trained modules and save it if acceleratorismainprocess pipeline StableDiffusionPipelinefrompretrained pretrainedmodelnameorpath textencoderacceleratorunwrapmodeltextencoder tokenizertokenizer vaevae unetunet pipelinesavepretrainedoutputdir Also save the newly trained embeddings savepath ospathjoinoutputdir flearnedembedsbin saveprogresstextencoder placeholdertokenid accelerator savepath 43 Run the Training import accelerate numgpus 1 specify the number of GPUs you would like to use This also depends on your machine config acceleratenotebooklaunchertrainingfunction argstextencoder vae unet numprocessesnumgpus for param in itertoolschainunetparameters textencoderparameters if paramgrad is not None del paramgrad free some memory torchcudaemptycache Step5 Run Inference with the newly trained Model Bravo Our model training is complete and we have taught our model a new concept namely cattoy Let us now test our newly trained model by running inference against it and see the results 51 Set up the pipeline The newly trained model artifacts are available in the output directory specified while setting up the training args We will use those artifacts to load the model and setup the pipeline DreamboothTextual Inversionfrom diffusers import DPMSolverMultistepScheduler outputdir argsoutputdir pipe StableDiffusionPipelinefrompretrained outputdir schedulerDPMSolverMultistepSchedulerfrompretrainedoutputdir subfolderscheduler torchdtypetorchfloat16 tocuda from diffusers import DPMSolverMultistepScheduler outputdir hyperparametersoutputdir pipe StableDiffusionPipelinefrompretrained outputdir schedulerDPMSolverMultistepSchedulerfrompretrainedoutputdir subfolderscheduler torchdtypetorchfloat16 tocuda 52 Run the Stable Diffusion pipeline Dont forget to use the placeholder token in your prompt prompt a cattoy in mad max fury road type str numsamples 2 type int number of samples to generate for the prompt images pipe prompt numimagesperpromptnumsamples numinferencesteps30 guidancescale9 images you can play around with the newly trained model by changing the prompt numinferencesteps and guidancescale and see the difference in results grid imagegridimages rows1 colsnumsamples grid Output Step6 Save the newly created concept Our model training is complete and we have also tested it by successfully generating some image samples We shall now save the model artifacts to preserve our newly created concept This will also enable us to launch an Inference server against it as described in the next section 61 Save the Model artifacts DreamboothTextual Inversionmodelartifactsdir dreamboothmodel specify the directory to save the model artifacts osmakedirsmodelartifactsdir existokTrue pipe2savepretrainedmodelartifactsdir save the model artifacts modelartifactsdir textualinversionmodel specify the directory to save the model artifacts osmakedirsmodelartifactsdir existokTrue pipe1savepretrainedmodelartifactsdir save the model artifacts In case of Textual Inversion the learned concept is stored in the learnedembedsbin file Hence this file will be required every time we need to load this concept cp outputdirlearnedembedsbin modelartifactsdir 62 Create Model on TIR Go to TIR Dashboard Choose a project navigate to the Models section and click on Create Model Enter a model name of your choosing eg stablediffusion Select Model Type as Custom click on CREATE You will now see details of EOS E2E Object Storage bucket created for this model EOS Provides a S3 compatible API to upload or download content We will be using MinIO CLI in this tutorial Copy the Setup Host command from Setup MinIO CLI tab We will use it to setup MinIO CLI in the next step Note In case you forget to copy the setup host command for MinIO CLI dont worry You can always go back to model details and get it again 63 Upload the Artifacts to Model Bucket We have already created the model on TIR Lets set it up on our notebook and upload the artifacts to the model Lets again go back to our TIR Notebook named stablediffusionfinetune that we used to finetune the model in the previous steps and follow the steps below In the jupyter labs click New Launcher and select Terminal Setup the MinIO CLI by running the Setup Host command copied in Step62 Go to the directory modelartifactsdir where we saved the model artifacts in step61 using the below command DreamboothTextual Inversionexport modelartifactsdirdreamboothmodel cd modelartifactsdir export modelartifactsdirtextualinversionmodel cd modelartifactsdir Copy the model artifacts to the model bucket Go to TIR Dashboard Models Select your model Copy the cp command from Setup MinIO CLI tab The copy command would look like this mc cp r MODELNAME stablediffusionstablediffusion854588 Here we will replace MODELNAME with to upload all contents of the current folder to the bucket We will append modelartifactsdir to the bucket path to upload the contents to a folder named modelartifactsdir inside the bucket so that your copy command would look something like this mc cp r stablediffusionstablediffusion854588modelartifactsdir Note The above command to copy model artifacts should not be used as it is It is just a sample command to show what the command would look like You may follow the above steps to generate the copy command that will be specific to your model bucket Your model artifacts will be saved successfully upon upload completion Step7 Create Inference Server against our newly trained model What now remains is to create an Inference Server against our trained model and serve API requests Note If you are not much familiar with Inference creation on TIR follow this tutorial for a detailed and stepbystep guide on Model Endpoint Inference Creation for Stable Diffusion 71 Create a new Model Endpoint in TIR Create a new Model Endpoint in TIR with Stable Diffusion Framework and a GPU Machine Plan Important In the Model Details Subsection choose the Model that we created in Step62 Make sure to specify the modelartifactsdir path This is necessary because our trained model artifacts are present in this directory 72 Generate your API Token The model endpoint API requires a valid auth token which youll need to perform further steps So generate a new API Token from the API Tokens Section or use an existing token if already created An apikey and an auth token will be generated Copy this auth token You will need it in the next step 73 Make API Request to generate Image output The final step is to send API requests to the created model endpoint generate images using text prompts We will use TIR Notebook to do the same Once your model is Ready visit the Sample API Request section of that model and copy the Python code Launch a TIR Notebook with PyTorch or StableDiffusion Image with any basic machine plan Once it is in Running state launch it and start a new notebook untitledipynb in the jupyter labs Paste the Sample API Request code for Python in the notebook cell Copy the Auth Token generated in Step72 use it in place of AUTHTOKEN in the Sample API Request Replace the prompt string in the payload with the below prompt This ensures the use of placeholder token in the prompt in our case cattoy to get the desired output a cattoy in mad max fury road Execute the code and send request Youll get a list of tensors as output This is because Stable Diffusion v21 model endpoint return the generated images as a list of PyTorch Tensors To view the generated images copy the below code paste it in the notebook cell and execute it Youll be able to view the generated images import torch import torchvisiontransforms as transforms def displayimagestensorimagedatalist convert PyTorch Tensors to PIL Image for tensordata in tensorimagedatalist tensorimage torchtensortensordatagetdata initialise the tensor pilimg transformsToPILImagetensorimage convert to PIL Image pilimgshow to save the generatedimages uncomment the line below imagesavetensordatagetname if responsestatuscode 200 displayimagesresponsejsongetpredictions Output Thats it We have successfully taught our model a new concept cattoy The Stable Diffusion model supports various other parameters for controlling the generation of image output Refer to Supported parameters for image generation for more details Conclusion Through this tutorial we finetuned the Stable Diffusion v21 model using two training methods namely Dreambooth and Textual Inversion By giving just 35 images as input we taught new concept to the model and could personalise the model on our own images After finetuning we also saw how we can store the trained model artifacts to TIR Model Storage launch Inference Servers using the same to serve API Requests On this page About Training methods Dreambooth Textual Inversion Fine tuning the model Step1 Launch a Notebook on TIR Step2 Initial Setup Step3 Settings for teaching the new concept Step4 Teach the model the new concept Finetuning with the training method Step5 Run Inference with the newly trained Model Step6 Save the newly created concept Step7 Create Inference Server against our newly trained model Conclusion Products TIR AI Platform GPU Dedicated Compute CPU Intensive Cloud High Memory Cloud Linux Smart Dedicated cPanel Linux Cloud Windows Cloud Windows SQL Cloud Plesk Windows Cloud GPU Smart Dedicated Load Balancer Company About Us Meet the Team Become a Partner E2E in Media Testimonials Investors Careers Contact Us Contact Sales Escalation Matrix Service Level Agreement Terms of Service Privacy Policy Refund Policy Policy FAQ Resources Blog Events Service Health Status Help White Papers Ecosystem Enablers Customers Certifications Countries Served FAQs E2E Networks Limited E2E Networks Limited is a NSE Listed AIFirst Hyperscale Cloud Computing Platform CIN Number L72900DL2009PLC341980 Copyright 2023 E2E Networks Limited


High Memory Series Claim your spot on the waitlist for the NVIDIA H100 GPUs Join WaitlistE2E CloudProductsPricingPartnersEventsCareersCompanyInvestorContact UsBlogLoginLoginSign UpHigh Memory SeriesThe 2nd generation Memory Intensive computing node plans are designed to offer double the amount of vCPUs and more than triple the amount of RAM at the same price compared to the first generation Experience higher throughputs by enhanced storage and improved networkingLaunch GPUContact SalesCheck Out The Pricing By Clicking HereProduct Enquiry Form Name RequiredEmail RequiredPhone RequiredCompany OptionalThank you Your submission has been received An expert from our sales team will contact you shortlyOops Something went wrong while submitting the formTable of ContentsExample H2Example H3Example H4Example H5Example H6Multiple Usecases One SolutionE2Es GPU Cloud is suitable for a wide range of usesBenefits of E2E GPU CloudNo Hidden FeesNo hidden or additional charges What you see on pricing charts is what you payNVIDIA Certified Elite CSP PartnerWe are NVIDIA Certified Elite Cloud Service provider partner Build or launch preinstalled software Cloud GPUs to ease your workNVIDIA Certified HardwareWe are using NVIDIA certified hardware for GPU accelerated workloadsFlexible PricingWe are offering pay as you go model to long tenure plans Easy upgrade allowed Option to increase storage allowedGPUaccelerated 1click NGC ContainersE2E Cloud GPUs have super simple one click support for NGC containers for deploying NVIDIA certified solutions for AIMLNLPComputer Vision and Data Science workloadsTrusted by 15000 ClientsView More Documentation ResourcesRead MoreRead MoreRead MoreI recently signed up with E2E Networks for their Cloud Server services and I have been very impressed with their Linux servers The service is not only very affordable but it also offers great performance and reliability I would highly recommend E2E Networks to anyone looking for a reliable and costeffective cloud server provider especially for Indian clients Proud WadhwaDjango Developer Great Future Technology Pvt LtdThis is one of the best cloud server providers as we are part of this provider and using it the service and other things are good and accurateHardeep Singh AhluwaliaSenior Manager IT Infra Successive TechnologiesWe have been using E2E Networks for the past 6 months and I am extremely satisfied with the service and the customer support Their servers are quite reliable and very costeffective especially the GPU machines The team is always ready to solve any problem however small Very happy to make E2E Networks our longterm partnersHarshit AgrawalData Scientist at Studio SirahHave been using E2E Networks infra for a decade now and never had any issues Scootsy ran 80 of the workload on E2E Networks before it was acquired by SwiggyKunal ShethFounder GottaGo Ex CTO at ScootsyAntfarm We at CamCom are using E2E GPU servers for a while now and the priceperformance is the best in the Indian market We also have enjoyed a fast turnaround from the support and sales team always I highly recommend the E2E GPU servers for machine learning deep learning and Image processing purposeMr Uma MaheshCOO at CamCom AIE2E Cloud is NextGen PaaS IaaS provider It is a fully augmented and automated platform that is the best in practice in the current Cloud market We are using E2E Networks for more than 5 years and are very much satisfied with the deliverables They have very affordable pricing and are changemaker in the Indian Hosting IndustryMr Devarsh PandyaFounder at CantechE2E GPU machines are superior in terms of performance and at the same time you end up saving more money compared to AWS and Azure Not to mention the agility and skilled customer support that comes alongArvind SainiVP of Engineering at Crownit GoldVIPThe customer support that E2E has provided us is beyond exceptional Their quick response is what makes them stand apart from others and is second to none in the cloud space Weve been using their GPU instances for our Deep Learning workloads for quite a long time The quality of service is amazing at a competitive price and we strongly recommend E2EAkshay Kumar CFounder COO at Marsviewai incCongratulations Thanks for the fast reliable and costeffective solution for my small startup since Mar 2016Ratul NandiLead Software Engineer Gartner previously CEBYou guys are doing everything perfectly I couldnt ask for anything more Keep it up Very happy with the serviceMr Mayank MalhotraDirector ZenwebnetE2E Networks has helped me reach my 1st goal with its cloud platform They gave us a trial to get used to the service Happy with their product will surely recommend others to try it once Good support so farShahnawaz Alam CTO HW Wellness Solutions Pvt LtdFor most startups AWS EC2 is unnecessarily costly Even better for India get a machine from E2E NetworksNaman SarawagiFounder FindYogiI am very much happy with E2E Networks Pvt Ltd Im using your services for the past year and I have provided E2E with multiple clients Whoever is looking for servers I strongly recommend E2E NetworksProtik BanerjeeRelcode Technology Pvt LtdI had a pleasant experience with E2E Network when I purchase the cPanel license plan They provided the onboarding support when I generated a ticket for the purchase Everything was delivered swiftly without any problemsChaitanyakumar GajjarFounder Infinity Software SolutionsPlease reach out to e2e networks if you need any cloud services their service is awesome I want to rate 55 for their servicesShreekethIssaniWe are using E2E Cloud servers since last 2 years Very happy with costeffective and highperformance compute nodes We were able to reduce our hosting expenses by 40 without compromising on quality security and stabilityVinod PandeyCofounder CTO myCBSEguideReally good service from E2E Networks And at very affordable prices We are satisfied with them The Cloud console access feature is a very good and very easy user interface And I am satisfied with the service features and Highperformance network for data uploaddownloadVarun SharmaCeo WebFreakSolutionEasy to Manage Easy to pay Low Cost Charan SinghSr Manager Crayons Advertising Pvt LtdI have been using E2E Cloud for almost a year now These guys are the most professional of all the cloud providers in India They have absolutely reliable products and also charge the lowest rate I would like to recommend it to all who are looking for COST Effective cloud serversNaresh KumarSystem Administrator Aravali College of Engg MgmtOur experience with E2E has been better than AWS as our website is performing better both in terms of latency and uptime Since E2E provides plans that are simple to understand implement and are a complete package our efforts are concentrated on the development and not on maintaining the infrastructureArjun GuptaSenior Manager Pharma Synth Formulations LimitedWe have been using Kubernetes cluster on E2E Cloud and are reasonably satisfied with its performance We were able to reduce our costs by 40 after migrating from Azure My big thanks to the E2E Cloud team for launching a Cloud and helping Indian startups in reducing their cloud costsAmarjeet SinghCoFounder CTO ZenatixThe platform is comfortable support is good 2 years anniversary completed in E2EMr Yonti LevinCoFounder CTO at LooraAbout UsE2E Networks Ltd is an Indiafocused Cloud Computing Company pioneering the introduction of contractless cloud computing for Indian startups and SMEs The E2E Networks Cloud has been employed by numerous successfully scaledup startups such as Zomato Cardekho Healthkart Junglee Games 1mg and many others It played a crucial role in facilitating their growth from the startup stage to achieving multimillion Daily Active Users DAUsLearn MoreWhat Our Customers SayFor over a decade we have delighted our customers with stellar infrastructure and supportI recently signed up with E2E Networks for their Cloud Server services and I have been very impressed with their Linux servers The service is not only very affordable but it also offers great performance and reliability I would highly recommend E2E Networks to anyone looking for a reliable and costeffective cloud server provider especially for Indian clients Proud WadhwaDjango Developer Great Future Technology Pvt LtdPress and Media MentionsListed on NSE Emerge Backed by Blume Ventures Loved by PressFrequently Asked QuestionsHow is the monthly pricing calculated Monthly prices shown are calculated using an assumed usage of 730 hours per month actual monthly costs may vary based on the number of days in a monthDo you include Tax in the prices listed on the website No price is exclusive of any taxes all plan pricing is subject to an 18 GST rate Build on the most powerful infrastructure cloudGet Started for FreeContact SalesProductsCPU Intensive CloudHigh Memory CloudLinux Smart DedicatedcPanel Linux CloudWindows CloudWindows SQL CloudPlesk Windows CloudGPU Smart DedicatedLoad BalancerCompanyAbout UsMeet the TeamBecome a PartnerE2E in MediaTestimonialsInvestorsCareersContact UsContact SalesEscalation MatrixService Level AgreementTerms of ServicePrivacy PolicyRefund PolicyPolicy FAQResourcesBlogEventsService Health StatusHelpWhitePapersEcosystem EnablersCustomersCertificationsCountries ServedFAQsE2E CloudE2E Networks Limited is Indias fastest growing accelerated cloud computing playerSubscribe to our newsletterGet latest news articles resources and trends delivered to your inbox weeklyThank you Your submission has been receivedOops Something went wrong while submitting the formCIN Number L72900DL2009PLC341980 Copyright 2024 E2E Networks Limited YouTubeInstagram