Package: segmindapi
Segmind API WrapperWrapper for Segmind API for using Generative models.
VisitWebsiteInstallationSimply Install the pip package by typing the following in the terminal:pip install segmindapiUsageImport Required Model Classfrom segmindapi import KadinskyInstantite Model Class with yourAPI Keymodel = Kadinsky(api_key)Generate Imageimg = model.generate(prompt)View Imageimg.show()Models SupportedCheck AvailableModelsControlNetImage to Image using Stable Diffusion 1.5.Available Options:CannyDepthOpenPoseScribbleSoftEdgefrom segmindapi import ControlNetmodel = ControlNet(api_key)img = model.generate(prompt, imageUrl, option)For additional options, check Docstring of the model.SD2_1Text-to-image Stable diffusion 2.1 model that can generateÂ images given a natural language prompt.from segmindapi import SD2_1model = SD2_1(api_key)img = model.generate(prompt)For additional options, check Docstring of the model.KadinskyImage-to-image Kadinsky model that can generateÂ images given a natural language prompt.from segmindapi import Kadinskymodel = Kadinsky(api_key)img = model.generate(prompt)For additional options, check Docstring of the model.SD1_5 Img2ImgA text-to-image diffusion model that can create photorealistic images from any given text input, and additionally has the ability to fill in missing parts of an image by using a mask.from segmindapi import SD1_5For additional options, check Docstring of the model.ERSGANAn image-to-image model that upscales low-resolution images into high-resolution ones using a GAN trained on a dataset of high-resolution images.from segmindapi import ERSGANFor additional options, check Docstring of the model.BackgroundRemovalThe background removal model efficiently separates the main subject or the object from its surrounding background, resulting in a clean and isolated foreground.from segmindapi import BackgroundRemovalFor additional options, check Docstring of the model.CodeformerCodeFormer is a robust face restoration algorithm for old photos or AI-generated faces.from segmindapi import CodeformerFor additional options, check Docstring of the model.SAMSegment Anything Model (SAM) is a state-of-the-art image segmentation model that can segment any object in an image.from segmindapi import SAMmodel = SAM(api_key)img = model.generate(imageUrl)For additional options, check Docstring of the model.FaceSwapFaceSwap is a state-of-the-art face swapping model that can swap faces in images and videos.from segmindapi import FaceSwapmodel = FaceSwap(api_key)img = model.generate(imageUrl, maskUrl)For additional options, check Docstring of the model.SDOutpaintingThe SDOutpainting model is used for outpainting tasks, where the model is given a part of an image and it needs to generate the rest of the image.from segmindapi import SDOutpaintingmodel = SDOutpainting(api_key)img = model.generate(imageUrl)For additional options, check Docstring of the model.Word2ImgA text-to-image model that can generate images from any given text input.from segmindapi import Word2Imgmodel = Word2Img(api_key)img = model.generate(image, prompt)For additional options, check Docstring of the model.QRGeneratorA QR code generator that can generate QR codes from any given text input.from segmindapi import QRGeneratormodel = QRGenerator(api_key)img = model.generate(prompt, qr_text)For additional options, check Docstring of the model.Text To ImageWe support several text to image models:Stable Diffusion XL 1.0Segmind Tiny-SDSegmind Tiny-SD (Portrait)Segmind Small-SDParagonRealistic VisionReliberateRevanimatedColorfulCartoonEdge of RealismEpic RealismRPGScifiCyber RealisticSamaritanRCNZ - CartoonManmarumixMajicmixJuggernaut FinalIcbinpFruit FusionFlat 2dFantassified IconsDvArchDream ShaperDeep Spaced DiffusionCute Rich StyleAll in one pixel526mixYou can check the complete list of modelshere.ExamplesModelCode ExampleGenerated ImageStable Diffusion XLSDXL(api_key).generate(prompt = "cinematic film still, 4k, realistic, ((cinematic photo:1.3)) of panda wearing a blue spacesuit, sitting in a bar, Fujifilm XT3, long shot, ((low light:1.4)), ((looking straight at the camera:1.3)), upper body shot, somber, shallow depth of field, vignette, highly detailed, high budget Hollywood movie, bokeh, cinemascope, moody, epic, gorgeous, film grain, grainy")Stable Diffusion OutpaintingSDOutpainting(api_key).generate(image = "https://www.segmind.com//image5.png", prompt = "streets in italy")QR GeneratorQRGenerator(api_key).generate(prompt = "A mouth-watering pizza topped with gooey cheese and fresh ingredients, Close-up, Realistic Style, Art Inspirations from Food Photography", qr_text = "www.segmind.com")Word2ImgWord2Img(api_key).generate(image = "https://www.segmind.com//word2img_input.png", prompt = "top-view, A mouth-watering pizza topped with gooey cheese and fresh ingredients,Food Photography")KadinskyKadinsky(api_key).generate("tiny isometric city on a tiny floating island, highly detailed, 3d render")Stable Diffusion v2.1SD2_1(api_key).generate("calico cat wearing a cosmonaut suit, 3d render, pixar style, 8k, high resolution")Stable Diffusion img2imgSD1_5(api_key).generate(prompt = "A fantasy landscape, trending on artstation, mystical sky", imageUrl= "https://segmind.com/sd-img2img-input.jpeg")Stable Diffusion InpaintingSD1_5(api_key).generate(prompt = "mecha robot sitting on a bench", imageUrl= "https://segmind.com/inpainting-input-image.jpeg", maskUrl= "https://segmind.com/inpainting-input-mask.jpeg")ControlNet OpenposeControlNet(api_key).generate(prompt = "a beautiful fashion model, wearing a red polka dress, red door background. hyperrealistic. photorealism, 4k, extremely detailed", imageUrl = "https://segmind.com/fashion2.jpeg", option="OpenPose")ControlNet ScribbleControlNet(api_key).generate(prompt = "steampunk underwater helmet, dark ocean background", imageUrl = "https://segmind.com/scribble-input.jpeg", option="Scribble")ControlNet Soft EdgeControlNet(api_key).generate(prompt = "royal chamber with fancy bed", imageUrl = "https://segmind.com/soft-edge-input.jpeg", option="SoftEdge")ControlNet DepthControlNet(api_key).generate(prompt = "young african american man, black suit, smiling, white background", imageUrl = "https://segmind.com/depth.jpeg", option="Depth")ControlNet CannyControlNet(api_key).generate(prompt = "a colorful bird, 4k", imageUrl = "https://segmind.com/canny-input.jpeg", option="Canny")Background RemovalBackgroundRemoval(api_key).generate(imageUrl = "https://segmind.com/bg-removal.jpg")Face SwapperFaceSwap(api_key).generate(imageUrl = "https://segmind.com/elon.jpg", maskUrl = "https://segmind.com/burn.gif")CodeformerCodeformer(api_key).generate(imageUrl = "https://segmind.com/codeformer_input.png")ESRGANESRGAN(api_key).generate(imageUrl = "https://segmind.com/butterfly.png")SAMSAM(api_key).generate(imageUrl = "https://segmind.com/kitchen.jpg")DependenciesPIL (Python Imaging Library)